Ensure that boot script is run in uninterrupted task.
This commit is contained in:
parent
340dddc792
commit
646f1eaf80
1 changed files with 11 additions and 2 deletions
|
|
@ -237,6 +237,10 @@ esp_err_t http_draw(httpd_req_t* req) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Error handling
|
// TODO: Error handling
|
||||||
|
// TODO: Ensure that `run_lua_string` is executed in an uninterrupted task;
|
||||||
|
// this means we need to set the task prio of the current request.
|
||||||
|
// Execute the Lua script received as post body; this is executed as a
|
||||||
|
// FreeRTOS task that will not be interrupted
|
||||||
run_lua_string(buf, "E-Paper Script via HTTP");
|
run_lua_string(buf, "E-Paper Script via HTTP");
|
||||||
heap_caps_free(buf);
|
heap_caps_free(buf);
|
||||||
|
|
||||||
|
|
@ -285,8 +289,13 @@ void app_main(void) {
|
||||||
register_http_routes(server);
|
register_http_routes(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run script in assets/epaper.lua
|
// Run script in assets/epaper.lua; this is executed as a FreeRTOS task
|
||||||
|
// that may not be interrupted
|
||||||
|
void runLuaFile (void* arg) {
|
||||||
run_lua_file("epaper.lua", "E-Paper Startup Script");
|
run_lua_file("epaper.lua", "E-Paper Startup Script");
|
||||||
|
vTaskDelete(NULL);
|
||||||
|
}
|
||||||
|
xTaskCreate(runLuaFile, "run_lua_file", 4096, NULL, tskIDLE_PRIORITY, NULL);
|
||||||
|
|
||||||
ESP_LOGI(TAG, "End of application.");
|
ESP_LOGI(TAG, "End of application.");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue