feat(esp8266): Add option to init OS before starting it

This commit is contained in:
dongheng
2019-03-25 20:12:58 +08:00
parent 12eb093aee
commit c378e07232
2 changed files with 14 additions and 0 deletions

View File

@ -236,6 +236,15 @@ config CRYSTAL_USED_40MHZ
bool "40MHz"
endchoice
config INIT_OS_BEFORE_START
bool "Init OS before starting it"
default n
depends on DISABLE_FREERTOS
help
Some OSes should initialize their global data structure before starting them. rt-thread is like this one.
FreeRTOS need not do this.
config ESP8266_OTA_FROM_OLD
bool "(**Expected**)ESP8266 update from old SDK by OTA"
default n

View File

@ -155,6 +155,11 @@ void call_user_start(size_t start_addr)
heap_caps_init();
#ifdef CONFIG_INIT_OS_BEFORE_START
extern int __esp_os_init(void);
assert(__esp_os_init() == 0);
#endif
#if defined(CONFIG_NEWLIB_LIBRARY_LEVEL_NORMAL) || defined(CONFIG_NEWLIB_LIBRARY_LEVEL_NANO)
esp_newlib_init();
#endif