Added the (possibly modified) Espressif SDK to the project to avoid problems with building. This may not be OK license wise, but who cares
This commit is contained in:
+45
@@ -0,0 +1,45 @@
|
||||
|
||||
#############################################################
|
||||
# Required variables for each makefile
|
||||
# Discard this section from all parent makefiles
|
||||
# Expected variables (with automatic defaults):
|
||||
# CSRCS (all "C" files in the dir)
|
||||
# SUBDIRS (all subdirs with a Makefile)
|
||||
# GEN_LIBS - list of libs to be generated ()
|
||||
# GEN_IMAGES - list of images to be generated ()
|
||||
# COMPONENTS_xxx - a list of libs/objs in the form
|
||||
# subdir/lib to be extracted and rolled up into
|
||||
# a generated lib/image xxx.a ()
|
||||
#
|
||||
ifndef PDIR
|
||||
GEN_LIBS = libuser.a
|
||||
endif
|
||||
|
||||
|
||||
#############################################################
|
||||
# Configuration i.e. compile options etc.
|
||||
# Target specific stuff (defines etc.) goes in here!
|
||||
# Generally values applying to a tree are captured in the
|
||||
# makefile at its root level - these are then overridden
|
||||
# for a subtree within the makefile rooted therein
|
||||
#
|
||||
#DEFINES +=
|
||||
|
||||
#############################################################
|
||||
# Recursion Magic - Don't touch this!!
|
||||
#
|
||||
# Each subtree potentially has an include directory
|
||||
# corresponding to the common APIs applicable to modules
|
||||
# rooted at that subtree. Accordingly, the INCLUDE PATH
|
||||
# of a module can only contain the include directories up
|
||||
# its parent path, and not its siblings
|
||||
#
|
||||
# Required for each makefile to inherit from the parent
|
||||
#
|
||||
|
||||
INCLUDES := $(INCLUDES) -I $(PDIR)include
|
||||
INCLUDES += -I ./
|
||||
INCLUDES += -I ../../include/ets
|
||||
PDIR := ../$(PDIR)
|
||||
sinclude $(PDIR)Makefile
|
||||
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/******************************************************************************
|
||||
* Copyright 2013-2014 Espressif Systems (Wuxi)
|
||||
*
|
||||
* FileName: user_main.c
|
||||
*
|
||||
* Description: entry file of user application
|
||||
*
|
||||
* Modification history:
|
||||
* 2015/7/3, v1.0 create this file.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "osapi.h"
|
||||
#include "user_interface.h"
|
||||
|
||||
#include "driver/key.h"
|
||||
|
||||
#define WPS_KEY_NUM 1
|
||||
|
||||
#define WPS_KEY_IO_MUX PERIPHS_IO_MUX_MTCK_U
|
||||
#define WPS_KEY_IO_NUM 13
|
||||
#define WPS_KEY_IO_FUNC FUNC_GPIO13
|
||||
|
||||
LOCAL struct keys_param keys;
|
||||
LOCAL struct single_key_param *single_key;
|
||||
|
||||
LOCAL void ICACHE_FLASH_ATTR
|
||||
user_wps_status_cb(int status)
|
||||
{
|
||||
switch (status) {
|
||||
case WPS_CB_ST_SUCCESS:
|
||||
wifi_wps_disable();
|
||||
wifi_station_connect();
|
||||
break;
|
||||
case WPS_CB_ST_FAILED:
|
||||
case WPS_CB_ST_TIMEOUT:
|
||||
wifi_wps_start();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LOCAL void ICACHE_FLASH_ATTR
|
||||
user_wps_key_short_press(void)
|
||||
{
|
||||
wifi_wps_disable();
|
||||
wifi_wps_enable(WPS_TYPE_PBC);
|
||||
wifi_set_wps_cb(user_wps_status_cb);
|
||||
wifi_wps_start();
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
user_rf_pre_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
user_init(void)
|
||||
{
|
||||
single_key = key_init_single(WPS_KEY_IO_NUM, WPS_KEY_IO_MUX, WPS_KEY_IO_FUNC,
|
||||
NULL, user_wps_key_short_press);
|
||||
|
||||
keys.key_num = WPS_KEY_NUM;
|
||||
keys.single_key = &single_key;
|
||||
|
||||
key_init(&keys);
|
||||
|
||||
wifi_set_opmode(STATION_MODE);
|
||||
}
|
||||
Reference in New Issue
Block a user