Merge branch 'esp-wifi-cfg-update'
This commit is contained in:
commit
7f8966203f
5 changed files with 42 additions and 1 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -46,3 +46,6 @@
|
|||
[submodule "lvgl/lv_examples"]
|
||||
path = lvgl/lv_examples
|
||||
url = https://github.com/littlevgl/lv_examples.git
|
||||
[submodule "extras/wifi-config-v2"]
|
||||
path = extras/wifi-config-v2
|
||||
url = https://github.com/Rutger798/esp-wifi-config.git
|
||||
|
|
18
examples/wifi-config-v2/Makefile
Normal file
18
examples/wifi-config-v2/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Makefile for wificfg example
|
||||
PROGRAM=wifi-config-v2
|
||||
EXTRA_COMPONENTS=extras/wifi-config-v2 extras/http-parser extras/dhcpserver
|
||||
|
||||
# For the mDNS responder included under extras:
|
||||
#EXTRA_COMPONENTS += extras/mdnsresponder
|
||||
#EXTRA_CFLAGS += -DEXTRAS_MDNS_RESPONDER
|
||||
|
||||
# For the mDNS responder included with lwip:
|
||||
EXTRA_CFLAGS += -DLWIP_MDNS_RESPONDER=1 -DLWIP_NUM_NETIF_CLIENT_DATA=1 -DLWIP_NETIF_EXT_STATUS_CALLBACK=1
|
||||
|
||||
# Avoid writing the wifi state to flash when using wificfg.
|
||||
EXTRA_CFLAGS += -DWIFI_PARAM_SAVE=0
|
||||
|
||||
# enable debugging for the wifi config tasks
|
||||
EXTRA_CFLAGS += -DWIFI_CONFIG_DEBUG
|
||||
|
||||
include ../../common.mk
|
19
examples/wifi-config-v2/main.c
Normal file
19
examples/wifi-config-v2/main.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include <stdio.h>
|
||||
#include <esp/uart.h>
|
||||
|
||||
#include "wifi_config.h"
|
||||
|
||||
|
||||
void on_wifi_event(wifi_config_event_t event) {
|
||||
if (event == WIFI_CONFIG_CONNECTED) {
|
||||
printf("Connected to WiFi\n");
|
||||
} else if (event == WIFI_CONFIG_DISCONNECTED) {
|
||||
printf("Disconnected from WiFi\n");
|
||||
}
|
||||
}
|
||||
|
||||
void user_init(void) {
|
||||
uart_set_baud(0, 115200);
|
||||
|
||||
wifi_config_init2("my-accessory", NULL, on_wifi_event);
|
||||
}
|
|
@ -97,7 +97,7 @@ int _gettimeofday_r(struct _reent *r, struct timeval *tp, void *tzp) {
|
|||
if (tzp || !tp) return EINVAL;
|
||||
|
||||
if (sntp_base == 0) {
|
||||
printf("Time not valid yet");
|
||||
printf("Time not valid yet\n");
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
|
|
1
extras/wifi-config-v2
Submodule
1
extras/wifi-config-v2
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 287b8a0c717412a970c14c2603058bc041b11928
|
Loading…
Reference in a new issue