1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-23 08:45:22 +03:00

Added NONOS SDK 3.0.0 ~ 3.0.5 (again) (#8736)

* Added NONOS SDK 3.0.0 ~ 3.0.5

* Added user_pre_init

* rf_cal[0] !=0x05,is 0x00

* # Remove mem_manager.o from libmain.a to use custom heap implementation, and time.o to fix redefinition of time-related functions
# Rename `hostname` and `default_hostname` symbols

* user_rf_pre_init

* Add system_func1() called by system_restart_local()

* Add commit log text

* Fixed user_rf_pre_init

* Style

* pio sdks

Co-authored-by: TAiGA <>
Co-authored-by: Maxim Prokhorov <prokhorov.max@outlook.com>
This commit is contained in:
metarutaiga
2022-12-06 18:43:48 +08:00
committed by GitHub
parent ed6b957164
commit 93537f94a8
88 changed files with 2889 additions and 57 deletions

View File

@ -303,7 +303,7 @@ bool ESP8266WiFiGenericClass::setSleepMode(WiFiSleepType_t type, uint8_t listenI
*/
#ifdef NONOSDK3V0
#if (NONOSDK >= (0x30000 - 1))
#ifdef DEBUG_ESP_WIFI
if (listenInterval && type == WIFI_NONE_SLEEP)
@ -334,9 +334,9 @@ bool ESP8266WiFiGenericClass::setSleepMode(WiFiSleepType_t type, uint8_t listenI
}
}
}
#else // !defined(NONOSDK3V0)
#else // (NONOSDK >= (0x30000 - 1))
(void)listenInterval;
#endif // !defined(NONOSDK3V0)
#endif // (NONOSDK >= (0x30000 - 1))
bool ret = wifi_set_sleep_type((sleep_type_t) type);
if (!ret) {
@ -571,10 +571,10 @@ bool ESP8266WiFiGenericClass::forceSleepWake() {
* @return interval
*/
uint8_t ESP8266WiFiGenericClass::getListenInterval () {
#ifndef NONOSDK3V0
return 0;
#else
#if (NONOSDK >= (0x30000 - 1))
return wifi_get_listen_interval();
#else
return 0;
#endif
}
@ -583,10 +583,10 @@ uint8_t ESP8266WiFiGenericClass::getListenInterval () {
* @return true if max level
*/
bool ESP8266WiFiGenericClass::isSleepLevelMax () {
#ifndef NONOSDK3V0
return false;
#else
#if (NONOSDK >= (0x30000 - 1))
return wifi_get_sleep_level() == MAX_SLEEP_T;
#else
return false;
#endif
}

View File

@ -61,7 +61,7 @@ static bool sta_config_equal(const station_config& lhs, const station_config& rh
*/
static bool sta_config_equal(const station_config& lhs, const station_config& rhs) {
#ifdef NONOSDK3V0
#if (NONOSDK >= (0x30000 - 1))
static_assert(sizeof(station_config) == 116, "struct station_config has changed, please update comparison function");
#else
static_assert(sizeof(station_config) == 112, "struct station_config has changed, please update comparison function");
@ -94,8 +94,18 @@ static bool sta_config_equal(const station_config& lhs, const station_config& rh
return false;
}
#ifdef NONOSDK3V0
if (lhs.open_and_wep_mode_disable != rhs.open_and_wep_mode_disable) {
#if (NONOSDK >= (0x30000 - 1))
if(lhs.open_and_wep_mode_disable != rhs.open_and_wep_mode_disable) {
return false;
}
#endif
#if (NONOSDK >= (0x30200))
if(lhs.channel != rhs.channel) {
return false;
}
if(lhs.all_channel_scan != rhs.all_channel_scan) {
return false;
}
#endif
@ -156,9 +166,13 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
}
conf.threshold.rssi = -127;
#ifdef NONOSDK3V0
#if (NONOSDK >= (0x30000 - 1))
conf.open_and_wep_mode_disable = !(_useInsecureWEP || *conf.password == 0);
#endif
#if (NONOSDK >= (0x30200))
conf.channel = channel;
conf.all_channel_scan = true;
#endif
if(bssid) {
conf.bssid_set = 1;