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
@@ -4,8 +4,8 @@
|
||||
#include <esp_heap_caps.h>
|
||||
#include <freertos/FreeRTOS.h>
|
||||
#include <freertos/task.h>
|
||||
#include <tactility/lvgl_fonts.h>
|
||||
#include <tt_lvgl.h>
|
||||
#include <lvgl/lvgl_fonts.h>
|
||||
#include <lvgl/lvgl.h>
|
||||
#include <tt_lvgl_toolbar.h>
|
||||
|
||||
static const char* TAG = "MediaKeys";
|
||||
@@ -154,24 +154,24 @@ void MediaKeys::btEventCallback(struct Device* /*device*/, void* context, struct
|
||||
|
||||
if (event.radio_state == BT_RADIO_STATE_ON) {
|
||||
// Radio is now up - start HID (needs LVGL lock for UI update)
|
||||
if (tt_lvgl_lock(1000)) {
|
||||
if (lvgl_try_lock(1000)) {
|
||||
// Re-check inside lock to avoid TOCTOU race with handleSwitchToggle(false)
|
||||
if (self->_radioEnabling) {
|
||||
self->startHid();
|
||||
}
|
||||
tt_lvgl_unlock();
|
||||
lvgl_unlock();
|
||||
}
|
||||
} else if (event.radio_state == BT_RADIO_STATE_OFF && self->_isEnabled) {
|
||||
// Radio dropped while we were active - revert UI
|
||||
LOG_I(TAG, "BT radio turned off, disabling HID");
|
||||
if (tt_lvgl_lock(1000)) {
|
||||
if (lvgl_try_lock(1000)) {
|
||||
if (tt_lvgl_hardware_keyboard_is_available()) self->exitKeyMode();
|
||||
self->_hidDevice = nullptr;
|
||||
self->_isEnabled = false;
|
||||
self->_radioEnabling = false;
|
||||
if (self->_switchWidget) lv_obj_remove_state(self->_switchWidget, LV_STATE_CHECKED);
|
||||
if (self->_mainWrapper) lv_obj_add_flag(self->_mainWrapper, LV_OBJ_FLAG_HIDDEN);
|
||||
tt_lvgl_unlock();
|
||||
lvgl_unlock();
|
||||
}
|
||||
}
|
||||
} else if (event.type == BT_EVENT_PROFILE_STATE_CHANGED && event.profile_state.profile == BT_PROFILE_HID_DEVICE) {
|
||||
|
||||
@@ -2,7 +2,7 @@ manifest.version=0.2
|
||||
target.sdk=0.8.0-dev
|
||||
target.platforms=esp32s3,esp32p4
|
||||
app.id=one.tactility.mediakeys
|
||||
app.version.name=0.4.0
|
||||
app.version.code=4
|
||||
app.version.name=0.5.0
|
||||
app.version.code=5
|
||||
app.name=Media Keys
|
||||
app.description=Bluetooth media keys. Touch or Physical Keyboard control\nB - previous, P - play/pause, N - next, M - mute, D - volume down, U - volume up.\nQ or ESC to exit focus.
|
||||
|
||||
Reference in New Issue
Block a user