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 59a9f85 commit ac459eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hardware/esp8266com/esp8266/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 ac459eb

Please sign in to comment.