diff --git a/components/base_nodemcu/uart.c b/components/base_nodemcu/uart.c index ee9641e5..218b3c9c 100644 --- a/components/base_nodemcu/uart.c +++ b/components/base_nodemcu/uart.c @@ -20,9 +20,11 @@ bool uart_on_data_cb(unsigned id, const char *buf, size_t len){ if(!gL) return false; + int top = lua_gettop(gL); lua_rawgeti(gL, LUA_REGISTRYINDEX, uart_status[id].receive_rf); lua_pushlstring(gL, buf, len); lua_pcall(gL, 1, 0, 0); + lua_settop(gL, top); return !run_input; } @@ -34,9 +36,11 @@ bool uart_on_error_cb(unsigned id, const char *buf, size_t len){ if(!gL) return false; + int top = lua_gettop(gL); lua_rawgeti(gL, LUA_REGISTRYINDEX, uart_status[id].error_rf); lua_pushlstring(gL, buf, len); lua_pcall(gL, 1, 0, 0); + lua_settop(gL, top); return true; } diff --git a/components/task/task.c b/components/task/task.c index 3a3e0e20..9fa69e6f 100644 --- a/components/task/task.c +++ b/components/task/task.c @@ -55,7 +55,7 @@ task_handle_t task_get_id(task_callback_t t) { } -bool task_post (task_prio_t priority, task_handle_t handle, task_param_t param) +bool IRAM_ATTR task_post (task_prio_t priority, task_handle_t handle, task_param_t param) { if (priority >= TASK_PRIORITY_COUNT || (handle & TASK_HANDLE_MASK) != TASK_HANDLE_MONIKER)