mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-08-05 22:11:04 +08:00
Merge branch 'feature/remove_wps_example' into 'master'
feat(wps): Remove wps example See merge request sdk/ESP8266_RTOS_SDK!357
This commit is contained in:
@ -1,9 +0,0 @@
|
||||
#
|
||||
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
|
||||
# project subdirectory.
|
||||
#
|
||||
|
||||
PROJECT_NAME := wps_example
|
||||
|
||||
include $(IDF_PATH)/make/project.mk
|
||||
|
@ -1,5 +0,0 @@
|
||||
#
|
||||
# "main" pseudo-component makefile.
|
||||
#
|
||||
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
|
||||
|
@ -1,56 +0,0 @@
|
||||
/* WPS example
|
||||
|
||||
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
||||
|
||||
Unless required by applicable law or agreed to in writing, this
|
||||
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "esp_sta.h"
|
||||
#include "esp_system.h"
|
||||
#include "esp_wps.h"
|
||||
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
|
||||
static void user_wps_status_cb(int status)
|
||||
{
|
||||
printf("scan status %d\n", 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;
|
||||
}
|
||||
}
|
||||
|
||||
static void user_wps_start(void)
|
||||
{
|
||||
wifi_wps_disable();
|
||||
wifi_wps_enable(WPS_TYPE_PBC);
|
||||
wifi_set_wps_cb(user_wps_status_cb);
|
||||
wifi_wps_start();
|
||||
}
|
||||
|
||||
static void wps_task(void* pvParameters)
|
||||
{
|
||||
wifi_set_opmode(STATION_MODE);
|
||||
user_wps_start();
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
void user_init(void)
|
||||
{
|
||||
xTaskCreate(wps_task, "wps_task", 4096, NULL, 4, NULL);
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
This is a simple project template.
|
||||
|
||||
sample_lib is an example for multi-level folder Makefile, notice the folder structure and each Makefile, you can get the clue.
|
||||
|
||||
|
||||
HOWTO:
|
||||
1. Copy this folder to anywhere.
|
||||
Example:
|
||||
Copy to ~/workspace/project_template
|
||||
You can rename this folder as you like.
|
||||
|
||||
2. Export SDK_PATH and BIN_PATH.
|
||||
Example:
|
||||
Your SDK path is ~/esp_iot_rtos_sdk, and want generate bin at ~/esp8266_bin.
|
||||
Do follow steps:
|
||||
1>. export SDK_PATH=~/esp_iot_rtos_sdk
|
||||
2>. export BIN_PATH=~/esp8266_bin
|
||||
SDK and project are seperate, you can update SDK without change your project.
|
||||
|
||||
3. Enter project_template folder, run ./gen_misc.sh, and follow the tips and steps.
|
||||
|
||||
|
||||
Compile Options:
|
||||
(1) COMPILE
|
||||
Possible value: xcc
|
||||
Default value:
|
||||
If not set, use gcc by default.
|
||||
|
||||
(2) BOOT
|
||||
Possible value: none/old/new
|
||||
none: no need boot
|
||||
old: use boot_v1.1
|
||||
new: use boot_v1.2
|
||||
Default value: new
|
||||
|
||||
(3) APP
|
||||
Possible value: 0/1/2
|
||||
0: original mode, generate eagle.app.v6.flash.bin and eagle.app.v6.irom0text.bin
|
||||
1: generate user1
|
||||
2: generate user2
|
||||
Default value: 0
|
||||
|
||||
(3) SPI_SPEED
|
||||
Possible value: 20/26.7/40/80
|
||||
Default value: 40
|
||||
|
||||
(4) SPI_MODE
|
||||
Possible value: QIO/QOUT/DIO/DOUT
|
||||
Default value: QIO
|
||||
|
||||
(4) SPI_SIZE_MAP
|
||||
Possible value: 0/2/3/4/5/6
|
||||
Default value: 0
|
||||
|
||||
For example:
|
||||
make COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE_MAP=0
|
Reference in New Issue
Block a user