void start_cmd(void *dummy) { #ifndef V7_NO_FS #ifndef DISABLE_OTA fs_init(get_fs_addr(), FS_SIZE); #else fs_init(FS_ADDR, FS_SIZE); #endif #endif init_v7(&dummy); #if !defined(NO_PROMPT) uart_main_init(0); #endif #ifndef V7_NO_FS init_smartjs(); #endif #ifndef DISABLE_OTA finish_update(); #endif #if !defined(NO_PROMPT) sj_prompt_init(v7); #endif }
/* * SmartJS initialization; for non-RTOS env, called as an SDK timer callback * (`os_timer_...()`). For RTOS env, called by the dispatcher task. */ void sjs_init(void *dummy) { /* * In order to see debug output (at least errors) during boot we have to * initialize debug in this point. But default we put debug to UART0 with * level=LL_ERROR, then configuration is loaded this settings are overridden */ uart_debug_init(0, 0); uart_redirect_debug(1); cs_log_set_level(LL_ERROR); #ifndef V7_NO_FS #ifndef DISABLE_OTA fs_init(get_fs_addr(get_current_rom()), get_fs_size(get_current_rom())); finish_update(); #else fs_init(FS_ADDR, FS_SIZE); #endif #endif init_v7(&dummy); /* disable GC during further initialization */ v7_set_gc_enabled(v7, 0); #if !defined(NO_PROMPT) uart_main_init(0); #endif #ifndef V7_NO_FS init_smartjs(); #endif #if !defined(NO_PROMPT) sj_prompt_init(v7); #endif #ifdef ESP_UMM_ENABLE /* * We want to use our own heap functions instead of the ones provided by the * SDK. * * We have marked `pvPortMalloc` and friends weak, so that we can override * them with our own implementations, but to actually make it work, we have * to reference any function from the file with our implementation, so that * linker will not garbage-collect the whole compilation unit. * * So, we have a call to the no-op `esp_umm_init()` here. */ esp_umm_init(); #endif /* SJS initialized, enable GC back, and trigger it */ v7_set_gc_enabled(v7, 1); v7_gc(v7, 1); }
int main() { sei(); uart_main_init(&uart0); timer_main_init(); port_main_init(); action_main_init(); while (1) { emu_sheave(); if(uart_rx_done(&uart0)) { } } }
void start_cmd(void *dummy) { #ifndef V7_NO_FS fs_init(); #endif init_v7(&dummy); #if !defined(NO_PROMPT) uart_main_init(0); #endif #ifndef V7_NO_FS init_smartjs(); #endif #if !defined(NO_PROMPT) sj_prompt_init(v7); #endif }