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:
Ken Van Hoeylandt
2026-07-26 12:47:03 +02:00
committed by GitHub
parent 25b966a340
commit 4f635d38e3
45 changed files with 200 additions and 257 deletions
@@ -10,13 +10,15 @@ UnitDualButton::~UnitDualButton() {
bool UnitDualButton::begin(Device* controller, gpio_pin_t pinA, gpio_pin_t pinB) {
if (!controller) return false;
descA_ = gpio_descriptor_acquire(controller, pinA, GPIO_OWNER_GPIO);
gpio_flags_t flags = GPIO_FLAG_DIRECTION_INPUT | GPIO_FLAG_PULL_UP;
descA_ = gpio_descriptor_acquire(controller, pinA, flags, GPIO_OWNER_GPIO);
if (!descA_) {
ESP_LOGW(TAG, "Failed to acquire pin %d", (int)pinA);
return false;
}
descB_ = gpio_descriptor_acquire(controller, pinB, GPIO_OWNER_GPIO);
descB_ = gpio_descriptor_acquire(controller, pinB, flags, GPIO_OWNER_GPIO);
if (!descB_) {
ESP_LOGW(TAG, "Failed to acquire pin %d", (int)pinB);
gpio_descriptor_release(descA_);
@@ -24,20 +26,6 @@ bool UnitDualButton::begin(Device* controller, gpio_pin_t pinA, gpio_pin_t pinB)
return false;
}
gpio_flags_t flags = GPIO_FLAG_DIRECTION_INPUT | GPIO_FLAG_PULL_UP;
if (gpio_descriptor_set_flags(descA_, flags) != ERROR_NONE) {
ESP_LOGW(TAG, "Failed to configure pin %d flags", (int)pinA);
gpio_descriptor_release(descA_); gpio_descriptor_release(descB_);
descA_ = descB_ = nullptr;
return false;
}
if (gpio_descriptor_set_flags(descB_, flags) != ERROR_NONE) {
ESP_LOGW(TAG, "Failed to configure pin %d flags", (int)pinB);
gpio_descriptor_release(descA_); gpio_descriptor_release(descB_);
descA_ = descB_ = nullptr;
return false;
}
ready_ = true;
ESP_LOGI(TAG, "DualButton ready on pins %d/%d", (int)pinA, (int)pinB);
return true;
@@ -1,19 +1,20 @@
#pragma once
#include <Tactility/Lock.h>
#include <tt_lvgl.h>
#include <lvgl/lvgl.h>
class LvglLock final : public tt::Lock {
public:
bool lock(TickType_t timeout = tt::kernel::MAX_TICKS) const override {
return tt_lvgl_lock(timeout);
using tt::Lock::lock;
bool lock(TickType_t timeout) const override {
return lvgl_try_lock(timeout);
}
void unlock() const override {
tt_lvgl_unlock();
lvgl_unlock();
}
};