Create TactilityFreertos subproject (#440)

This commit is contained in:
Ken Van Hoeylandt
2026-01-03 00:19:40 +01:00
committed by GitHub
parent a4dc633063
commit 7283920def
154 changed files with 1926 additions and 2676 deletions
@@ -1,11 +1,11 @@
#include "TpagerKeyboard.h"
#include <Tactility/hal/i2c/I2c.h>
#include <driver/i2c.h>
#include <driver/gpio.h>
#include <Tactility/Log.h>
#include <driver/i2c.h>
#include <driver/gpio.h>
constexpr auto* TAG = "TpagerKeyboard";
constexpr auto BACKLIGHT = GPIO_NUM_46;
@@ -120,12 +120,12 @@ bool TpagerKeyboard::startLvgl(lv_display_t* display) {
keypad->init(KB_ROWS, KB_COLS);
assert(inputTimer == nullptr);
inputTimer = std::make_unique<tt::Timer>(tt::Timer::Type::Periodic, [this] {
inputTimer = std::make_unique<tt::Timer>(tt::Timer::Type::Periodic, tt::kernel::millisToTicks(20), [this] {
processKeyboard();
});
assert(backlightImpulseTimer == nullptr);
backlightImpulseTimer = std::make_unique<tt::Timer>(tt::Timer::Type::Periodic, [this] {
backlightImpulseTimer = std::make_unique<tt::Timer>(tt::Timer::Type::Periodic, tt::kernel::millisToTicks(50), [this] {
processBacklightImpulse();
});
@@ -135,8 +135,8 @@ bool TpagerKeyboard::startLvgl(lv_display_t* display) {
lv_indev_set_display(kbHandle, display);
lv_indev_set_user_data(kbHandle, this);
inputTimer->start(20 / portTICK_PERIOD_MS);
backlightImpulseTimer->start(50 / portTICK_PERIOD_MS);
inputTimer->start();
backlightImpulseTimer->start();
return true;
}
@@ -125,7 +125,7 @@ bool CardputerKeyboard::startLvgl(lv_display_t* display) {
keypad->init(7, 8);
assert(inputTimer == nullptr);
inputTimer = std::make_unique<tt::Timer>(tt::Timer::Type::Periodic, [this] {
inputTimer = std::make_unique<tt::Timer>(tt::Timer::Type::Periodic, pdMS_TO_TICKS(20), [this] {
processKeyboard();
});
@@ -135,7 +135,7 @@ bool CardputerKeyboard::startLvgl(lv_display_t* display) {
lv_indev_set_display(kbHandle, display);
lv_indev_set_user_data(kbHandle, this);
inputTimer->start(20 / portTICK_PERIOD_MS);
inputTimer->start();
return true;
}
+5 -4
View File
@@ -1,13 +1,14 @@
#include "LvglTask.h"
#include <Tactility/Log.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/RecursiveMutex.h>
#include <Tactility/Thread.h>
#include <Tactility/Log.h>
#include <Tactility/RecursiveMutex.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/Check.h>
#include <lvgl.h>
#define TAG "lvgl_task"
constexpr auto TAG = "lvgl_task";
// Mutex for LVGL drawing
static tt::RecursiveMutex lvgl_mutex;
+1 -1
View File
@@ -1,6 +1,6 @@
#include "Main.h"
#include <Tactility/TactilityCore.h>
#include <Tactility/Thread.h>
#include <Tactility/TactilityCore.h>
#include "FreeRTOS.h"
#include "task.h"
+8 -4
View File
@@ -1,11 +1,12 @@
#include "UnPhoneFeatures.h"
#include <Tactility/app/App.h>
#include <Tactility/Log.h>
#include <Tactility/app/App.h>
#include <Tactility/kernel/Kernel.h>
#include <driver/gpio.h>
#include <driver/rtc_io.h>
#include <esp_io_expander.h>
#include <esp_sleep.h>
namespace pin {
@@ -36,8 +37,7 @@ static void IRAM_ATTR navButtonInterruptHandler(void* args) {
xQueueSendFromISR(interruptQueue, &pinNumber, NULL);
}
static int32_t buttonHandlingThreadMain(void* context) {
auto* interrupted = (bool*)context;
static int32_t buttonHandlingThreadMain(const bool* interrupted) {
int pinNumber;
while (!*interrupted) {
if (xQueueReceive(interruptQueue, &pinNumber, portMAX_DELAY)) {
@@ -99,7 +99,11 @@ bool UnPhoneFeatures::initNavButtons() {
buttonHandlingThread.setName("unphone_buttons");
buttonHandlingThread.setPriority(tt::Thread::Priority::High);
buttonHandlingThread.setStackSize(3072);
buttonHandlingThread.setCallback(buttonHandlingThreadMain, &buttonHandlingThreadInterruptRequest);
buttonHandlingThread.setMainFunction(
[this] {
return buttonHandlingThreadMain(&this->buttonHandlingThreadInterruptRequest);
}
);
buttonHandlingThread.start();
uint64_t pin_mask =