mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
Fix build
This commit is contained in:
parent
5d384d55b7
commit
4fdd546ad5
@ -27,7 +27,9 @@ extern "C" {
|
|||||||
//extern "C" void ets_wdt_init(uint32_t val);
|
//extern "C" void ets_wdt_init(uint32_t val);
|
||||||
extern "C" void ets_wdt_enable(void);
|
extern "C" void ets_wdt_enable(void);
|
||||||
extern "C" void ets_wdt_disable(void);
|
extern "C" void ets_wdt_disable(void);
|
||||||
extern "C" void wdt_feed(void);
|
extern "C" void wdt_feed(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User-defined Literals
|
* User-defined Literals
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
#include "eagle_soc.h"
|
#include "eagle_soc.h"
|
||||||
#include "ets_sys.h"
|
#include "ets_sys.h"
|
||||||
|
|
||||||
|
uint8_t esp8266_gpioToFn[16] = {0x34, 0x18, 0x38, 0x14, 0x3C, 0x40, 0x1C, 0x20, 0x24, 0x28, 0x2C, 0x30, 0x04, 0x08, 0x0C, 0x10};
|
||||||
|
|
||||||
extern void __pinMode(uint8_t pin, uint8_t mode) {
|
extern void __pinMode(uint8_t pin, uint8_t mode) {
|
||||||
if(pin < 16){
|
if(pin < 16){
|
||||||
if(mode == SPECIAL){
|
if(mode == SPECIAL){
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
#define GPCD 2 //DRIVER 0:normal,1:open drain
|
#define GPCD 2 //DRIVER 0:normal,1:open drain
|
||||||
#define GPCS 0 //SOURCE 0:GPIO_DATA,1:SigmaDelta
|
#define GPCS 0 //SOURCE 0:GPIO_DATA,1:SigmaDelta
|
||||||
|
|
||||||
static uint8_t esp8266_gpioToFn[16] = {0x34, 0x18, 0x38, 0x14, 0x3C, 0x40, 0x1C, 0x20, 0x24, 0x28, 0x2C, 0x30, 0x04, 0x08, 0x0C, 0x10};
|
extern uint8_t esp8266_gpioToFn[16];
|
||||||
#define GPF(p) ESP8266_REG(0x800 + esp8266_gpioToFn[(p & 0xF)])
|
#define GPF(p) ESP8266_REG(0x800 + esp8266_gpioToFn[(p & 0xF)])
|
||||||
|
|
||||||
#define GPMUX ESP8266_REG(0x800)
|
#define GPMUX ESP8266_REG(0x800)
|
||||||
|
@ -468,9 +468,10 @@ void ESP8266WiFiClass::beginSmartConfig()
|
|||||||
}
|
}
|
||||||
|
|
||||||
_smartConfigStarted = true;
|
_smartConfigStarted = true;
|
||||||
|
_smartConfigDone = false;
|
||||||
|
|
||||||
//SC_TYPE_ESPTOUCH use ESPTOUCH for smartconfig, or use SC_TYPE_AIRKISS for AIRKISS
|
//SC_TYPE_ESPTOUCH use ESPTOUCH for smartconfig, or use SC_TYPE_AIRKISS for AIRKISS
|
||||||
smartconfig_start(SC_TYPE_ESPTOUCH, &ESP8266WiFiClass::_smartConfigDone);
|
smartconfig_start(SC_TYPE_ESPTOUCH, reinterpret_cast<sc_callback_t>(&ESP8266WiFiClass::_smartConfigCallback), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ESP8266WiFiClass::stopSmartConfig()
|
void ESP8266WiFiClass::stopSmartConfig()
|
||||||
@ -482,22 +483,30 @@ void ESP8266WiFiClass::stopSmartConfig()
|
|||||||
_smartConfigStarted = false;
|
_smartConfigStarted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ESP8266WiFiClass::smartConfigDone(){
|
bool ESP8266WiFiClass::smartConfigDone()
|
||||||
|
{
|
||||||
if (!_smartConfigStarted)
|
if (!_smartConfigStarted)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return smartconfig_get_status() == SC_STATUS_LINK_OVER;
|
return _smartConfigDone;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ESP8266WiFiClass::_smartConfigDone(void* result)
|
void ESP8266WiFiClass::_smartConfigCallback(uint32_t st, void* result)
|
||||||
{
|
{
|
||||||
|
sc_status status = (sc_status) st;
|
||||||
|
if (status == SC_STATUS_LINK) {
|
||||||
station_config* sta_conf = reinterpret_cast<station_config*>(result);
|
station_config* sta_conf = reinterpret_cast<station_config*>(result);
|
||||||
|
|
||||||
wifi_station_set_config(sta_conf);
|
wifi_station_set_config(sta_conf);
|
||||||
wifi_station_disconnect();
|
wifi_station_disconnect();
|
||||||
wifi_station_connect();
|
wifi_station_connect();
|
||||||
}
|
|
||||||
|
|
||||||
|
WiFi._smartConfigDone = true;
|
||||||
|
}
|
||||||
|
else if (status == SC_STATUS_LINK_OVER) {
|
||||||
|
WiFi.stopSmartConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ESP8266WiFiClass::printDiag(Print& p)
|
void ESP8266WiFiClass::printDiag(Print& p)
|
||||||
{
|
{
|
||||||
|
@ -287,8 +287,9 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
static void _scanDone(void* result, int status);
|
static void _scanDone(void* result, int status);
|
||||||
void * _getScanInfoByIndex(int i);
|
void * _getScanInfoByIndex(int i);
|
||||||
static void _smartConfigDone(void* result);
|
static void _smartConfigCallback(uint32_t status, void* result);
|
||||||
bool _smartConfigStarted = false;
|
bool _smartConfigStarted = false;
|
||||||
|
bool _smartConfigDone = false;
|
||||||
|
|
||||||
bool _useApMode;
|
bool _useApMode;
|
||||||
bool _useClientMode;
|
bool _useClientMode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user