Updates for removal of deprecated HAL (#37)
Update all apps to replace deprecated LVGL code and to use the new kernel APIs.
This commit is contained in:
committed by
GitHub
parent
25b966a340
commit
4f635d38e3
@@ -9,7 +9,7 @@
|
||||
#include <tt_app_fileselection.h>
|
||||
#include <tt_bundle.h>
|
||||
#include <tt_lock.h>
|
||||
#include <tt_lvgl.h>
|
||||
#include <lvgl/lvgl.h>
|
||||
#include <tt_lvgl_toolbar.h>
|
||||
|
||||
#include <esp_app_desc.h>
|
||||
@@ -18,6 +18,8 @@
|
||||
|
||||
#include <tactility/log.h>
|
||||
|
||||
constexpr TickType_t LVGL_DEFAULT_LOCK_TIME = 500; // 500 ticks = 500 ms
|
||||
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
|
||||
@@ -283,12 +285,12 @@ struct UiDispatchPayload {
|
||||
void EspNowBridge::dispatchToUi(void (*work)(EspNowBridge&, void*), void* context, void (*freeContext)(void*)) {
|
||||
auto* payload = new UiDispatchPayload{this, work, context, freeContext};
|
||||
// lv_async_call() itself is an LVGL operation and must be lock-guarded when called from a
|
||||
// non-LVGL task (see tt_lvgl_lock()'s doc comment) - the OTA worker task calls dispatchToUi()
|
||||
// non-LVGL task (see lvgl_lock()'s doc comment) - the OTA worker task calls dispatchToUi()
|
||||
// repeatedly during the transfer, and without this lock most of those calls were silently
|
||||
// racing LVGL's own task and getting lost (only the very last status update, right before
|
||||
// esp_restart(), happened to land - everything else stayed stuck at "Waiting for
|
||||
// co-processor link...").
|
||||
bool locked = tt_lvgl_lock(TT_LVGL_DEFAULT_LOCK_TIME);
|
||||
bool locked = lvgl_try_lock(LVGL_DEFAULT_LOCK_TIME);
|
||||
if (!locked) {
|
||||
// Without the lock, lv_async_call() itself would be touching LVGL's internal timer list
|
||||
// unguarded - and if it happened to still enqueue successfully, the callback below would
|
||||
@@ -310,7 +312,7 @@ void EspNowBridge::dispatchToUi(void (*work)(EspNowBridge&, void*), void* contex
|
||||
}
|
||||
delete payload;
|
||||
}, payload);
|
||||
tt_lvgl_unlock();
|
||||
lvgl_unlock();
|
||||
|
||||
if (result != LV_RESULT_OK) {
|
||||
if (freeContext != nullptr) {
|
||||
|
||||
@@ -2,7 +2,7 @@ manifest.version=0.2
|
||||
target.sdk=0.8.0-dev
|
||||
target.platforms=esp32p4
|
||||
app.id=one.tactility.espnowbridge
|
||||
app.version.name=0.1.0
|
||||
app.version.code=1
|
||||
app.version.name=0.2.0
|
||||
app.version.code=2
|
||||
app.name=ESP-NOW Bridge
|
||||
app.description=Companion app for updating P4 device C6 co-processor firmware to enable ESP-NOW bridge support.
|
||||
|
||||
Reference in New Issue
Block a user