Skip to content

Commit

Permalink
Only erase RTC RAM if sleep mode doesn't look valid (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Aug 5, 2015
1 parent 5cbaa57 commit e02932f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cores/esp8266/core_esp8266_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ void user_rf_pre_init() {
// *((volatile uint32_t*) 0x60000710) = 0;

volatile uint32_t* rtc_reg = (volatile uint32_t*) 0x60001000;
rtc_reg[30] = 0;
if((rtc_reg[24] >> 16) > 4) {
rtc_reg[24] &= 0xFFFF;
rtc_reg[30] = 0;
}

system_set_os_print(0);
__run_user_rf_pre_init();
Expand Down

0 comments on commit e02932f

Please sign in to comment.