From 5df981010a75a486f038cbf985903896cde0410e Mon Sep 17 00:00:00 2001 From: Johny Mattsson Date: Mon, 3 Oct 2016 13:05:17 +1100 Subject: [PATCH] Prevent UART/startup race ala 1517. We're already in the right context, there is no point posting back the Lua start, we can do it right then and there instead. --- components/base_nodemcu/user_main.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/components/base_nodemcu/user_main.c b/components/base_nodemcu/user_main.c index 50fd910f..e47d826b 100644 --- a/components/base_nodemcu/user_main.c +++ b/components/base_nodemcu/user_main.c @@ -83,9 +83,8 @@ static void handle_esp_event (task_param_t param, task_prio_t prio) // +================== New task interface ==================+ -static void start_lua(task_param_t param, task_prio_t prio) { - (void)param; - (void)prio; +static void start_lua () +{ char* lua_argv[] = { (char *)"lua", (char *)"-i", NULL }; NODE_DBG("Task task_lua started.\n"); lua_main( 2, lua_argv ); @@ -142,8 +141,6 @@ void nodemcu_init(void) // Note that fs_format leaves the file system mounted } #endif - - task_post_low(task_get_id(start_lua), 0); } @@ -170,6 +167,7 @@ void app_main (void) system_init (); tcpip_adapter_init (); + start_lua (); task_pump_messages (); __builtin_unreachable (); }