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.
This commit is contained in:
Johny Mattsson 2016-10-03 13:05:17 +11:00
parent e355057de6
commit 5df981010a
1 changed files with 3 additions and 5 deletions

View File

@ -83,9 +83,8 @@ static void handle_esp_event (task_param_t param, task_prio_t prio)
// +================== New task interface ==================+ // +================== New task interface ==================+
static void start_lua(task_param_t param, task_prio_t prio) { static void start_lua ()
(void)param; {
(void)prio;
char* lua_argv[] = { (char *)"lua", (char *)"-i", NULL }; char* lua_argv[] = { (char *)"lua", (char *)"-i", NULL };
NODE_DBG("Task task_lua started.\n"); NODE_DBG("Task task_lua started.\n");
lua_main( 2, lua_argv ); lua_main( 2, lua_argv );
@ -142,8 +141,6 @@ void nodemcu_init(void)
// Note that fs_format leaves the file system mounted // Note that fs_format leaves the file system mounted
} }
#endif #endif
task_post_low(task_get_id(start_lua), 0);
} }
@ -170,6 +167,7 @@ void app_main (void)
system_init (); system_init ();
tcpip_adapter_init (); tcpip_adapter_init ();
start_lua ();
task_pump_messages (); task_pump_messages ();
__builtin_unreachable (); __builtin_unreachable ();
} }