Merge branch 'feature/deepsleep_stub_linker' into 'master'

Deep sleep: Any source named rtc_wake_stub* is linked as RTC wake stub code

Also move esp_deepsleep.h documentation out to docs/deep-sleep-stub.rst

See merge request !142
This commit is contained in:
Ivan Grokhotkov
2016-11-01 22:27:13 +08:00
7 changed files with 134 additions and 54 deletions

View File

@@ -19,6 +19,7 @@
#include "rom/ets_sys.h"
#include "rom/uart.h"
#include "rom/rtc.h"
#include "soc/cpu.h"
#include "soc/dport_reg.h"
@@ -65,6 +66,8 @@ extern void app_main(void);
extern int _bss_start;
extern int _bss_end;
extern int _rtc_bss_start;
extern int _rtc_bss_end;
extern int _init_start;
extern void (*__init_array_start)(void);
extern void (*__init_array_end)(void);
@@ -95,6 +98,11 @@ void IRAM_ATTR call_start_cpu0()
memset(&_bss_start, 0, (&_bss_end - &_bss_start) * sizeof(_bss_start));
/* Unless waking from deep sleep (implying RTC memory is intact), clear RTC bss */
if (rtc_get_reset_reason(0) != DEEPSLEEP_RESET) {
memset(&_rtc_bss_start, 0, (&_rtc_bss_end - &_rtc_bss_start) * sizeof(_rtc_bss_start));
}
// Initialize heap allocator
heap_alloc_caps_init();