Skip to content

Commit 25b9494

Browse files
committed
Fix build
1 parent ae15989 commit 25b9494

File tree

5 files changed

+27
-13
lines changed

5 files changed

+27
-13
lines changed

hardware/esp8266com/esp8266/cores/esp8266/Esp.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ extern "C" {
2727
//extern "C" void ets_wdt_init(uint32_t val);
2828
extern "C" void ets_wdt_enable(void);
2929
extern "C" void ets_wdt_disable(void);
30-
extern "C" void wdt_feed(void);
30+
extern "C" void wdt_feed(void) {
31+
32+
}
3133

3234
/**
3335
* User-defined Literals

hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring_digital.c

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#include "eagle_soc.h"
2626
#include "ets_sys.h"
2727

28+
uint8_t esp8266_gpioToFn[16] = {0x34, 0x18, 0x38, 0x14, 0x3C, 0x40, 0x1C, 0x20, 0x24, 0x28, 0x2C, 0x30, 0x04, 0x08, 0x0C, 0x10};
29+
2830
extern void __pinMode(uint8_t pin, uint8_t mode) {
2931
if(pin < 16){
3032
if(mode == SPECIAL){

hardware/esp8266com/esp8266/cores/esp8266/esp8266_peri.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#define GPCD 2 //DRIVER 0:normal,1:open drain
6969
#define GPCS 0 //SOURCE 0:GPIO_DATA,1:SigmaDelta
7070

71-
static uint8_t esp8266_gpioToFn[16] = {0x34, 0x18, 0x38, 0x14, 0x3C, 0x40, 0x1C, 0x20, 0x24, 0x28, 0x2C, 0x30, 0x04, 0x08, 0x0C, 0x10};
71+
extern uint8_t esp8266_gpioToFn[16];
7272
#define GPF(p) ESP8266_REG(0x800 + esp8266_gpioToFn[(p & 0xF)])
7373

7474
#define GPMUX ESP8266_REG(0x800)

hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp

+19-10
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,10 @@ void ESP8266WiFiClass::beginSmartConfig()
468468
}
469469

470470
_smartConfigStarted = true;
471+
_smartConfigDone = false;
471472

472473
//SC_TYPE_ESPTOUCH use ESPTOUCH for smartconfig, or use SC_TYPE_AIRKISS for AIRKISS
473-
smartconfig_start(SC_TYPE_ESPTOUCH, &ESP8266WiFiClass::_smartConfigDone);
474+
smartconfig_start(SC_TYPE_ESPTOUCH, reinterpret_cast<sc_callback_t>(&ESP8266WiFiClass::_smartConfigCallback), 1);
474475
}
475476

476477
void ESP8266WiFiClass::stopSmartConfig()
@@ -482,22 +483,30 @@ void ESP8266WiFiClass::stopSmartConfig()
482483
_smartConfigStarted = false;
483484
}
484485

485-
bool ESP8266WiFiClass::smartConfigDone(){
486+
bool ESP8266WiFiClass::smartConfigDone()
487+
{
486488
if (!_smartConfigStarted)
487489
return false;
488490

489-
return smartconfig_get_status() == SC_STATUS_LINK_OVER;
491+
return _smartConfigDone;
490492
}
491493

492-
void ESP8266WiFiClass::_smartConfigDone(void* result)
494+
void ESP8266WiFiClass::_smartConfigCallback(uint32_t st, void* result)
493495
{
494-
station_config* sta_conf = reinterpret_cast<station_config*>(result);
495-
496-
wifi_station_set_config(sta_conf);
497-
wifi_station_disconnect();
498-
wifi_station_connect();
499-
}
496+
sc_status status = (sc_status) st;
497+
if (status == SC_STATUS_LINK) {
498+
station_config* sta_conf = reinterpret_cast<station_config*>(result);
499+
500+
wifi_station_set_config(sta_conf);
501+
wifi_station_disconnect();
502+
wifi_station_connect();
500503

504+
WiFi._smartConfigDone = true;
505+
}
506+
else if (status == SC_STATUS_LINK_OVER) {
507+
WiFi.stopSmartConfig();
508+
}
509+
}
501510

502511
void ESP8266WiFiClass::printDiag(Print& p)
503512
{

hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFi.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,9 @@ class ESP8266WiFiClass
287287
protected:
288288
static void _scanDone(void* result, int status);
289289
void * _getScanInfoByIndex(int i);
290-
static void _smartConfigDone(void* result);
290+
static void _smartConfigCallback(uint32_t status, void* result);
291291
bool _smartConfigStarted = false;
292+
bool _smartConfigDone = false;
292293

293294
bool _useApMode;
294295
bool _useClientMode;

0 commit comments

Comments
 (0)