Skip to content

Commit a6d1f73

Browse files
authored
Merge branch 'master' into wifioff
2 parents abd17a7 + a76ef29 commit a6d1f73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1044
-639
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Arduino core for ESP8266 WiFi chip
33

44
# Quick links
55

6-
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/3.1.1/)
6+
- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/3.1.2/)
77
- [Current "git version" documentation](https://arduino-esp8266.readthedocs.io/en/latest/)
88
- [Install git version](https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version) ([sources](doc/installing.rst#using-git-version))
99

@@ -36,7 +36,7 @@ Starting with 1.6.4, Arduino allows installation of third-party platform package
3636
#### Latest release [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/)
3737
Boards manager link: `https://arduino.esp8266.com/stable/package_esp8266com_index.json`
3838

39-
Documentation: [https://arduino-esp8266.readthedocs.io/en/3.1.1/](https://arduino-esp8266.readthedocs.io/en/3.1.1/)
39+
Documentation: [https://arduino-esp8266.readthedocs.io/en/3.1.2/](https://arduino-esp8266.readthedocs.io/en/3.1.2/)
4040

4141
### Using git version
4242

boards.txt

Lines changed: 267 additions & 0 deletions
Large diffs are not rendered by default.

bootloaders/eboot/eboot.elf

84 Bytes
Binary file not shown.

cores/esp8266/Stream.h

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,25 +167,49 @@ class Stream: public Print {
167167
// When result is 0 or less than requested maxLen, Print::getLastSend()
168168
// contains an error reason.
169169

170+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
171+
172+
// transfers already buffered / immediately available data (no timeout)
173+
// returns number of transferred bytes
174+
[[deprecated]] size_t sendAvailable (Print* to) { return sendGeneric(to, -1, -1, oneShotMs::alwaysExpired); }
175+
[[deprecated]] size_t sendAvailable (Print& to) { return sendAvailable(&to); }
176+
177+
// transfers data until timeout
178+
// returns number of transferred bytes
179+
[[deprecated]] size_t sendAll (Print* to, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, -1, -1, timeoutMs); }
180+
[[deprecated]] size_t sendAll (Print& to, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendAll(&to, timeoutMs); }
181+
182+
// transfers data until a char is encountered (the char is swallowed but not transferred) with timeout
183+
// returns number of transferred bytes
184+
[[deprecated]] size_t sendUntil (Print* to, const int readUntilChar, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, -1, readUntilChar, timeoutMs); }
185+
[[deprecated]] size_t sendUntil (Print& to, const int readUntilChar, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendUntil(&to, readUntilChar, timeoutMs); }
186+
187+
// transfers data until requested size or timeout
188+
// returns number of transferred bytes
189+
[[deprecated]] size_t sendSize (Print* to, const ssize_t maxLen, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, maxLen, -1, timeoutMs); }
190+
[[deprecated]] size_t sendSize (Print& to, const ssize_t maxLen, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendSize(&to, maxLen, timeoutMs); }
191+
192+
#pragma GCC diagnostic pop
193+
170194
// transfers already buffered / immediately available data (no timeout)
171195
// returns number of transferred bytes
172-
size_t sendAvailable (Print* to) { return sendGeneric(to, -1, -1, oneShotMs::alwaysExpired); }
173-
size_t sendAvailable (Print& to) { return sendAvailable(&to); }
196+
size_t sendAvailable (Stream* to) { return sendGeneric(to, -1, -1, oneShotMs::alwaysExpired); }
197+
size_t sendAvailable (Stream& to) { return sendAvailable(&to); }
174198

175199
// transfers data until timeout
176200
// returns number of transferred bytes
177-
size_t sendAll (Print* to, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, -1, -1, timeoutMs); }
178-
size_t sendAll (Print& to, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendAll(&to, timeoutMs); }
201+
size_t sendAll (Stream* to, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, -1, -1, timeoutMs); }
202+
size_t sendAll (Stream& to, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendAll(&to, timeoutMs); }
179203

180204
// transfers data until a char is encountered (the char is swallowed but not transferred) with timeout
181205
// returns number of transferred bytes
182-
size_t sendUntil (Print* to, const int readUntilChar, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, -1, readUntilChar, timeoutMs); }
183-
size_t sendUntil (Print& to, const int readUntilChar, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendUntil(&to, readUntilChar, timeoutMs); }
206+
size_t sendUntil (Stream* to, const int readUntilChar, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, -1, readUntilChar, timeoutMs); }
207+
size_t sendUntil (Stream& to, const int readUntilChar, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendUntil(&to, readUntilChar, timeoutMs); }
184208

185209
// transfers data until requested size or timeout
186210
// returns number of transferred bytes
187-
size_t sendSize (Print* to, const ssize_t maxLen, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, maxLen, -1, timeoutMs); }
188-
size_t sendSize (Print& to, const ssize_t maxLen, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendSize(&to, maxLen, timeoutMs); }
211+
size_t sendSize (Stream* to, const ssize_t maxLen, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendGeneric(to, maxLen, -1, timeoutMs); }
212+
size_t sendSize (Stream& to, const ssize_t maxLen, const oneShotMs::timeType timeoutMs = oneShotMs::neverExpires) { return sendSize(&to, maxLen, timeoutMs); }
189213

190214
// remaining size (-1 by default = unknown)
191215
virtual ssize_t streamRemaining () { return -1; }
@@ -202,11 +226,17 @@ class Stream: public Print {
202226
Report getLastSendReport () const { return _sendReport; }
203227

204228
protected:
229+
[[deprecated]]
205230
size_t sendGeneric (Print* to,
206231
const ssize_t len = -1,
207232
const int readUntilChar = -1,
208233
oneShotMs::timeType timeoutMs = oneShotMs::neverExpires /* neverExpires=>getTimeout() */);
209234

235+
size_t sendGeneric (Stream* to,
236+
const ssize_t len = -1,
237+
const int readUntilChar = -1,
238+
oneShotMs::timeType timeoutMs = oneShotMs::neverExpires /* neverExpires=>getTimeout() */);
239+
210240
size_t SendGenericPeekBuffer(Print* to, const ssize_t len, const int readUntilChar, const oneShotMs::timeType timeoutMs);
211241
size_t SendGenericRegularUntil(Print* to, const ssize_t len, const int readUntilChar, const oneShotMs::timeType timeoutMs);
212242
size_t SendGenericRegular(Print* to, const ssize_t len, const oneShotMs::timeType timeoutMs);

cores/esp8266/StreamSend.cpp

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,54 @@
2222
#include <Arduino.h>
2323
#include <StreamDev.h>
2424

25+
size_t Stream::sendGeneric(Stream* to, const ssize_t len, const int readUntilChar,
26+
const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
27+
{
28+
// "neverExpires (default, impossible)" is translated to default timeout
29+
esp8266::polledTimeout::oneShotFastMs::timeType inputTimeoutMs
30+
= timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout()
31+
: timeoutMs;
32+
33+
esp8266::polledTimeout::oneShotFastMs::timeType mainTimeoutMs = std::max(
34+
inputTimeoutMs, (esp8266::polledTimeout::oneShotFastMs::timeType)to->getTimeout());
35+
36+
setReport(Report::Success);
37+
38+
if (len == 0)
39+
{
40+
return 0; // conveniently avoids timeout for no requested data
41+
}
42+
43+
// There are two timeouts:
44+
// - read (network, serial, ...)
45+
// - write (network, serial, ...)
46+
// However
47+
// - getTimeout() is for reading only
48+
// - there is no getOutputTimeout() api
49+
// So we use getTimeout() for both,
50+
// (also when inputCanTimeout() is false)
51+
52+
if (hasPeekBufferAPI())
53+
{
54+
return SendGenericPeekBuffer(to, len, readUntilChar, mainTimeoutMs);
55+
}
56+
57+
if (readUntilChar >= 0)
58+
{
59+
return SendGenericRegularUntil(to, len, readUntilChar, mainTimeoutMs);
60+
}
61+
62+
return SendGenericRegular(to, len, mainTimeoutMs);
63+
}
64+
2565
size_t Stream::sendGeneric(Print* to, const ssize_t len, const int readUntilChar,
2666
const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
2767
{
68+
// "neverExpires (default, impossible)" is translated to default timeout
69+
esp8266::polledTimeout::oneShotFastMs::timeType inputTimeoutMs
70+
= timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout()
71+
: timeoutMs;
72+
2873
setReport(Report::Success);
2974

3075
if (len == 0)
@@ -43,25 +88,23 @@ size_t Stream::sendGeneric(Print* to, const ssize_t len, const int readUntilChar
4388

4489
if (hasPeekBufferAPI())
4590
{
46-
return SendGenericPeekBuffer(to, len, readUntilChar, timeoutMs);
91+
return SendGenericPeekBuffer(to, len, readUntilChar, inputTimeoutMs);
4792
}
4893

4994
if (readUntilChar >= 0)
5095
{
51-
return SendGenericRegularUntil(to, len, readUntilChar, timeoutMs);
96+
return SendGenericRegularUntil(to, len, readUntilChar, inputTimeoutMs);
5297
}
5398

54-
return SendGenericRegular(to, len, timeoutMs);
99+
return SendGenericRegular(to, len, inputTimeoutMs);
55100
}
56101

57102
size_t
58103
Stream::SendGenericPeekBuffer(Print* to, const ssize_t len, const int readUntilChar,
59104
const esp8266::polledTimeout::oneShotFastMs::timeType timeoutMs)
60105
{
61-
// "neverExpires (default, impossible)" is translated to default timeout
62-
esp8266::polledTimeout::oneShotFastMs timedOut(
63-
timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout()
64-
: timeoutMs);
106+
esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs);
107+
65108
// len==-1 => maxLen=0 <=> until starvation
66109
const size_t maxLen = std::max((ssize_t)0, len);
67110
size_t written = 0;
@@ -152,10 +195,8 @@ Stream::SendGenericRegularUntil(Print* to, const ssize_t len, const int readUnti
152195
// regular Stream API
153196
// no other choice than reading byte by byte
154197

155-
// "neverExpires (default, impossible)" is translated to default timeout
156-
esp8266::polledTimeout::oneShotFastMs timedOut(
157-
timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout()
158-
: timeoutMs);
198+
esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs);
199+
159200
// len==-1 => maxLen=0 <=> until starvation
160201
const size_t maxLen = std::max((ssize_t)0, len);
161202
size_t written = 0;
@@ -231,10 +272,8 @@ size_t Stream::SendGenericRegular(Print* to, const ssize_t len,
231272
// regular Stream API
232273
// use an intermediary buffer
233274

234-
// "neverExpires (default, impossible)" is translated to default timeout
235-
esp8266::polledTimeout::oneShotFastMs timedOut(
236-
timeoutMs >= esp8266::polledTimeout::oneShotFastMs::neverExpires ? getTimeout()
237-
: timeoutMs);
275+
esp8266::polledTimeout::oneShotFastMs timedOut(timeoutMs);
276+
238277
// len==-1 => maxLen=0 <=> until starvation
239278
const size_t maxLen = std::max((ssize_t)0, len);
240279
size_t written = 0;

cores/esp8266/TZ.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
// autogenerated from https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv
33
// by script <esp8266 arduino core>/tools/TZupdate.sh
4-
// Sat Jan 14 10:17:27 PM UTC 2023
4+
// Mon Mar 20 22:00:17 UTC 2023
55
//
66
// This database is autogenerated from IANA timezone database
77
// https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv
@@ -85,7 +85,7 @@
8585
#define TZ_America_Asuncion PSTR("<-04>4<-03>,M10.1.0/0,M3.4.0/0")
8686
#define TZ_America_Atikokan PSTR("EST5")
8787
#define TZ_America_Bahia PSTR("<-03>3")
88-
#define TZ_America_Bahia_Banderas PSTR("CST6CDT,M4.1.0,M10.5.0")
88+
#define TZ_America_Bahia_Banderas PSTR("CST6")
8989
#define TZ_America_Barbados PSTR("AST4")
9090
#define TZ_America_Belem PSTR("<-03>3")
9191
#define TZ_America_Belize PSTR("CST6")
@@ -100,7 +100,7 @@
100100
#define TZ_America_Cayenne PSTR("<-03>3")
101101
#define TZ_America_Cayman PSTR("EST5")
102102
#define TZ_America_Chicago PSTR("CST6CDT,M3.2.0,M11.1.0")
103-
#define TZ_America_Chihuahua PSTR("MST7MDT,M4.1.0,M10.5.0")
103+
#define TZ_America_Chihuahua PSTR("CST6")
104104
#define TZ_America_Costa_Rica PSTR("CST6")
105105
#define TZ_America_Creston PSTR("MST7")
106106
#define TZ_America_Cuiaba PSTR("<-04>4")
@@ -117,7 +117,7 @@
117117
#define TZ_America_Fortaleza PSTR("<-03>3")
118118
#define TZ_America_Fort_Nelson PSTR("MST7")
119119
#define TZ_America_Glace_Bay PSTR("AST4ADT,M3.2.0,M11.1.0")
120-
#define TZ_America_Godthab PSTR("<-03>3<-02>,M3.5.0/-2,M10.5.0/-1")
120+
#define TZ_America_Godthab PSTR("<-02>2")
121121
#define TZ_America_Goose_Bay PSTR("AST4ADT,M3.2.0,M11.1.0")
122122
#define TZ_America_Grand_Turk PSTR("EST5EDT,M3.2.0,M11.1.0")
123123
#define TZ_America_Grenada PSTR("AST4")
@@ -153,14 +153,14 @@
153153
#define TZ_America_Marigot PSTR("AST4")
154154
#define TZ_America_Martinique PSTR("AST4")
155155
#define TZ_America_Matamoros PSTR("CST6CDT,M3.2.0,M11.1.0")
156-
#define TZ_America_Mazatlan PSTR("MST7MDT,M4.1.0,M10.5.0")
156+
#define TZ_America_Mazatlan PSTR("MST7")
157157
#define TZ_America_Menominee PSTR("CST6CDT,M3.2.0,M11.1.0")
158-
#define TZ_America_Merida PSTR("CST6CDT,M4.1.0,M10.5.0")
158+
#define TZ_America_Merida PSTR("CST6")
159159
#define TZ_America_Metlakatla PSTR("AKST9AKDT,M3.2.0,M11.1.0")
160-
#define TZ_America_Mexico_City PSTR("CST6CDT,M4.1.0,M10.5.0")
160+
#define TZ_America_Mexico_City PSTR("CST6")
161161
#define TZ_America_Miquelon PSTR("<-03>3<-02>,M3.2.0,M11.1.0")
162162
#define TZ_America_Moncton PSTR("AST4ADT,M3.2.0,M11.1.0")
163-
#define TZ_America_Monterrey PSTR("CST6CDT,M4.1.0,M10.5.0")
163+
#define TZ_America_Monterrey PSTR("CST6")
164164
#define TZ_America_Montevideo PSTR("<-03>3")
165165
#define TZ_America_Montreal PSTR("EST5EDT,M3.2.0,M11.1.0")
166166
#define TZ_America_Montserrat PSTR("AST4")
@@ -172,8 +172,8 @@
172172
#define TZ_America_North_Dakota_Beulah PSTR("CST6CDT,M3.2.0,M11.1.0")
173173
#define TZ_America_North_Dakota_Center PSTR("CST6CDT,M3.2.0,M11.1.0")
174174
#define TZ_America_North_Dakota_New_Salem PSTR("CST6CDT,M3.2.0,M11.1.0")
175-
#define TZ_America_Nuuk PSTR("<-03>3<-02>,M3.5.0/-2,M10.5.0/-1")
176-
#define TZ_America_Ojinaga PSTR("MST7MDT,M3.2.0,M11.1.0")
175+
#define TZ_America_Nuuk PSTR("<-02>2")
176+
#define TZ_America_Ojinaga PSTR("CST6CDT,M3.2.0,M11.1.0")
177177
#define TZ_America_Panama PSTR("EST5")
178178
#define TZ_America_Pangnirtung PSTR("EST5EDT,M3.2.0,M11.1.0")
179179
#define TZ_America_Paramaribo PSTR("<-03>3")
@@ -227,7 +227,7 @@
227227
#define TZ_Arctic_Longyearbyen PSTR("CET-1CEST,M3.5.0,M10.5.0/3")
228228
#define TZ_Asia_Aden PSTR("<+03>-3")
229229
#define TZ_Asia_Almaty PSTR("<+06>-6")
230-
#define TZ_Asia_Amman PSTR("EET-2EEST,M2.5.4/24,M10.5.5/1")
230+
#define TZ_Asia_Amman PSTR("<+03>-3")
231231
#define TZ_Asia_Anadyr PSTR("<+12>-12")
232232
#define TZ_Asia_Aqtau PSTR("<+05>-5")
233233
#define TZ_Asia_Aqtobe PSTR("<+05>-5")
@@ -244,14 +244,14 @@
244244
#define TZ_Asia_Chita PSTR("<+09>-9")
245245
#define TZ_Asia_Choibalsan PSTR("<+08>-8")
246246
#define TZ_Asia_Colombo PSTR("<+0530>-5:30")
247-
#define TZ_Asia_Damascus PSTR("EET-2EEST,M3.5.5/0,M10.5.5/0")
247+
#define TZ_Asia_Damascus PSTR("<+03>-3")
248248
#define TZ_Asia_Dhaka PSTR("<+06>-6")
249249
#define TZ_Asia_Dili PSTR("<+09>-9")
250250
#define TZ_Asia_Dubai PSTR("<+04>-4")
251251
#define TZ_Asia_Dushanbe PSTR("<+05>-5")
252252
#define TZ_Asia_Famagusta PSTR("EET-2EEST,M3.5.0/3,M10.5.0/4")
253-
#define TZ_Asia_Gaza PSTR("EET-2EEST,M3.4.4/48,M10.5.5/1")
254-
#define TZ_Asia_Hebron PSTR("EET-2EEST,M3.4.4/48,M10.5.5/1")
253+
#define TZ_Asia_Gaza PSTR("EET-2EEST,M3.4.4/50,M10.4.4/50")
254+
#define TZ_Asia_Hebron PSTR("EET-2EEST,M3.4.4/50,M10.4.4/50")
255255
#define TZ_Asia_Ho_Chi_Minh PSTR("<+07>-7")
256256
#define TZ_Asia_Hong_Kong PSTR("HKT-8")
257257
#define TZ_Asia_Hovd PSTR("<+07>-7")
@@ -294,7 +294,7 @@
294294
#define TZ_Asia_Taipei PSTR("CST-8")
295295
#define TZ_Asia_Tashkent PSTR("<+05>-5")
296296
#define TZ_Asia_Tbilisi PSTR("<+04>-4")
297-
#define TZ_Asia_Tehran PSTR("<+0330>-3:30<+0430>,J79/24,J263/24")
297+
#define TZ_Asia_Tehran PSTR("<+0330>-3:30")
298298
#define TZ_Asia_Thimphu PSTR("<+06>-6")
299299
#define TZ_Asia_Tokyo PSTR("JST-9")
300300
#define TZ_Asia_Tomsk PSTR("<+07>-7")
@@ -409,7 +409,7 @@
409409
#define TZ_Pacific_Efate PSTR("<+11>-11")
410410
#define TZ_Pacific_Enderbury PSTR("<+13>-13")
411411
#define TZ_Pacific_Fakaofo PSTR("<+13>-13")
412-
#define TZ_Pacific_Fiji PSTR("<+12>-12<+13>,M11.2.0,M1.2.3/99")
412+
#define TZ_Pacific_Fiji PSTR("<+12>-12")
413413
#define TZ_Pacific_Funafuti PSTR("<+12>-12")
414414
#define TZ_Pacific_Galapagos PSTR("<-06>6")
415415
#define TZ_Pacific_Gambier PSTR("<-09>9")

cores/esp8266/core_esp8266_main.cpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,8 @@ extern "C" uint8_t uart_rx_one_char_block();
421421
#include "flash_hal.h"
422422
#endif
423423

424+
extern "C" void user_rf_pre_init();
425+
424426
extern "C" void ICACHE_FLASH_ATTR user_pre_init(void)
425427
{
426428
const char *flash_map_str = NULL;
@@ -620,16 +622,26 @@ extern "C" void ICACHE_FLASH_ATTR user_pre_init(void)
620622
uart_rx_one_char_block(); // Someone said hello - repeat message
621623
} while(true);
622624
}
625+
/*
626+
The function user_rf_pre_init() is no longer called from SDK 3.0 and up.
627+
The SDK manual and release notes skipped this detail. The 2023 ESP-FAQ
628+
hints at the change with "* Call system_phy_set_powerup_option(3) in
629+
function user_pre_init or user_rf_pre_init"
630+
https://docs.espressif.com/_/downloads/espressif-esp-faq/en/latest/pdf/#page=14
631+
632+
Add call to user_rf_pre_init(), so we can still perform early calls like
633+
system_phy_set_rfoption(rf_mode), system_phy_set_powerup_option(2), etc.
634+
635+
Placement, should this be at the beginning or end of user_pre_init()?
636+
By the end, we have registered the PHY_DATA partition; however, PHY_DATA
637+
read occurs after return and before user_init() is called.
638+
*/
639+
user_rf_pre_init();
623640
}
624641
#endif // #if (NONOSDK >= (0x30000))
625642

626643
extern "C" void user_init(void) {
627644

628-
#if (NONOSDK >= (0x30000))
629-
extern void user_rf_pre_init();
630-
user_rf_pre_init(); // Stop spoofing logic
631-
#endif
632-
633645
struct rst_info *rtc_info_ptr = system_get_rst_info();
634646
memcpy((void *) &resetInfo, (void *) rtc_info_ptr, sizeof(resetInfo));
635647

cores/esp8266/core_esp8266_phy.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ extern int IRAM_ATTR __wrap_spi_flash_read(uint32_t addr, uint32_t* dst, size_t
311311
return __real_spi_flash_read(addr, dst, size);
312312
}
313313

314+
#if (NONOSDK >= (0x30000))
315+
spoof_init_data = false;
316+
#endif
314317
memcpy(dst, phy_init_data, sizeof(phy_init_data));
315318
((uint8_t*)dst)[107] = __get_adc_mode();
316319
return 0;
@@ -361,7 +364,7 @@ extern void __run_user_rf_pre_init(void)
361364
#if (NONOSDK >= (0x30000))
362365
void sdk3_begin_phy_data_spoof(void)
363366
{
364-
spoof_init_data = true;
367+
spoof_init_data = true;
365368
}
366369
#else
367370
uint32_t user_rf_cal_sector_set(void)
@@ -374,7 +377,9 @@ uint32_t user_rf_cal_sector_set(void)
374377
void user_rf_pre_init()
375378
{
376379
// *((volatile uint32_t*) 0x60000710) = 0;
380+
#if (NONOSDK < (0x30000))
377381
spoof_init_data = false;
382+
#endif
378383

379384
int rf_mode = __get_rf_mode();
380385
if (rf_mode >= 0) {

0 commit comments

Comments
 (0)