Skip to content

Commit e02932f

Browse files
committed
Only erase RTC RAM if sleep mode doesn't look valid (#619)
Source: http://esp8266.ru/forum/threads/mem-check-fail.168/#post-7354
1 parent 5cbaa57 commit e02932f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: cores/esp8266/core_esp8266_phy.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,10 @@ void user_rf_pre_init() {
261261
// *((volatile uint32_t*) 0x60000710) = 0;
262262

263263
volatile uint32_t* rtc_reg = (volatile uint32_t*) 0x60001000;
264-
rtc_reg[30] = 0;
264+
if((rtc_reg[24] >> 16) > 4) {
265+
rtc_reg[24] &= 0xFFFF;
266+
rtc_reg[30] = 0;
267+
}
265268

266269
system_set_os_print(0);
267270
__run_user_rf_pre_init();

0 commit comments

Comments
 (0)