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,5 +1,6 @@
#include <Tactility/app/AppManifestParsing.h>
#include <Tactility/Log.h>
#include <regex>
namespace tt::app {
@@ -1,5 +1,7 @@
#ifdef ESP_PLATFORM
#include <Tactility/Timer.h>
#include <Tactility/Tactility.h>
#include <Tactility/app/AppManifest.h>
#include <Tactility/lvgl/Lvgl.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -9,8 +11,6 @@
#include <Tactility/service/development/DevelopmentSettings.h>
#include <Tactility/service/loader/Loader.h>
#include <Tactility/service/wifi/Wifi.h>
#include <Tactility/Tactility.h>
#include <Tactility/Timer.h>
#include <cstring>
#include <lvgl.h>
@@ -27,7 +27,7 @@ class DevelopmentApp final : public App {
lv_obj_t* statusLabel = nullptr;
std::shared_ptr<service::development::DevelopmentService> service;
Timer timer = Timer(Timer::Type::Periodic, [this] {
Timer timer = Timer(Timer::Type::Periodic, pdMS_TO_TICKS(1000), [this] {
auto lock = lvgl::getSyncLock()->asScopedLock();
// TODO: There's a crash when this is called when the app is being destroyed
if (lock.lock(lvgl::defaultLockTime) && lvgl::isStarted()) {
@@ -148,7 +148,7 @@ public:
updateViewState();
timer.start(1000);
timer.start();
}
void onHide(AppContext& appContext) override {
+1 -1
View File
@@ -5,7 +5,7 @@
#include <Tactility/hal/sdcard/SdCardDevice.h>
#include <Tactility/Log.h>
#include <Tactility/MountPoints.h>
#include <Tactility/kernel/Kernel.h>
#include <Tactility/kernel/Platform.h>
#include <cstring>
#include <unistd.h>
+5 -6
View File
@@ -1,24 +1,23 @@
#include <Tactility/app/files/View.h>
#include <Tactility/app/files/SupportedFiles.h>
#include <Tactility/file/File.h>
#include <Tactility/file/FileLock.h>
#include <Tactility/app/alertdialog/AlertDialog.h>
#include <Tactility/app/imageviewer/ImageViewer.h>
#include <Tactility/app/inputdialog/InputDialog.h>
#include <Tactility/app/notes/Notes.h>
#include <Tactility/app/ElfApp.h>
#include <Tactility/kernel/Platform.h>
#include <Tactility/Log.h>
#include <Tactility/lvgl/Toolbar.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/Tactility.h>
#include <Tactility/file/File.h>
#include <Tactility/Log.h>
#include <Tactility/StringUtils.h>
#include <Tactility/Tactility.h>
#include <cstring>
#include <cstdio>
#include <unistd.h>
#include <sys/stat.h>
#include <Tactility/file/FileLock.h>
#ifdef ESP_PLATFORM
#include <Tactility/service/loader/Loader.h>
+1 -1
View File
@@ -4,7 +4,7 @@
#include "Tactility/hal/sdcard/SdCardDevice.h"
#include <Tactility/Log.h>
#include <Tactility/MountPoints.h>
#include <Tactility/kernel/Kernel.h>
#include <Tactility/kernel/Platform.h>
#include <cstring>
#include <unistd.h>
+7 -6
View File
@@ -1,18 +1,19 @@
#include "Tactility/app/fileselection/View.h"
#include <Tactility/app/fileselection/View.h>
#include "Tactility/app/alertdialog/AlertDialog.h"
#include "Tactility/lvgl/Toolbar.h"
#include "Tactility/lvgl/LvglSync.h"
#include <Tactility/app/alertdialog/AlertDialog.h>
#include <Tactility/lvgl/Toolbar.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/Tactility.h>
#include "Tactility/file/File.h"
#include <Tactility/file/File.h>
#include <Tactility/StringUtils.h>
#include <Tactility/kernel/Platform.h>
#include <cstring>
#include <unistd.h>
#ifdef ESP_PLATFORM
#include "Tactility/service/loader/Loader.h"
#include <Tactility/service/loader/Loader.h>
#endif
namespace tt::app::fileselection {
@@ -1,5 +1,6 @@
#include <Tactility/Tactility.h>
#include <Tactility/Timer.h>
#include <Tactility/app/AppManifest.h>
#include <Tactility/app/alertdialog/AlertDialog.h>
#include <Tactility/lvgl/LvglSync.h>
@@ -7,7 +8,6 @@
#include <Tactility/service/gps/GpsService.h>
#include <Tactility/service/gps/GpsState.h>
#include <Tactility/service/loader/Loader.h>
#include <Tactility/Timer.h>
#include <cstring>
#include <format>
@@ -62,7 +62,7 @@ class GpsSettingsApp final : public App {
}
void startReceivingUpdates() {
timer->start(kernel::secondsToTicks(1));
timer->start();
updateViews();
}
@@ -268,7 +268,7 @@ class GpsSettingsApp final : public App {
public:
GpsSettingsApp() {
timer = std::make_unique<Timer>(Timer::Type::Periodic, [this] {
timer = std::make_unique<Timer>(Timer::Type::Periodic, kernel::secondsToTicks(1), [this] {
updateViews();
});
service = service::gps::findGpsService();
@@ -8,10 +8,10 @@
#include <Tactility/lvgl/Toolbar.h>
#include <Tactility/service/loader/Loader.h>
#include <Tactility/Timer.h>
#include <Tactility/Assets.h>
#include <Tactility/RecursiveMutex.h>
#include <Tactility/Tactility.h>
#include <Tactility/Timer.h>
#include <format>
@@ -278,10 +278,10 @@ void I2cScannerApp::startScanning() {
lv_obj_clean(scanListWidget);
scanState = ScanStateScanning;
scanTimer = std::make_unique<Timer>(Timer::Type::Once, [this]{
scanTimer = std::make_unique<Timer>(Timer::Type::Once, 10, [this]{
onScanTimer();
});
scanTimer->start(10);
scanTimer->start();
mutex.unlock();
} else {
TT_LOG_W(TAG, LOG_MESSAGE_MUTEX_LOCK_FAILED_FMT, "startScanning");
+9 -9
View File
@@ -1,12 +1,12 @@
#include "Tactility/app/AppContext.h"
#include "Tactility/lvgl/LvglSync.h"
#include "Tactility/lvgl/Style.h"
#include "Tactility/lvgl/Toolbar.h"
#include "Tactility/service/loader/Loader.h"
#include <Tactility/app/AppContext.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/lvgl/Style.h>
#include <Tactility/lvgl/Toolbar.h>
#include <Tactility/service/loader/Loader.h>
#include "Tactility/hal/power/PowerDevice.h"
#include <Tactility/Assets.h>
#include <Tactility/hal/power/PowerDevice.h>
#include <Tactility/Timer.h>
#include <Tactility/Assets.h>
#include <Tactility/hal/Device.h>
#include <lvgl.h>
@@ -31,7 +31,7 @@ std::shared_ptr<PowerApp> _Nullable optApp() {
class PowerApp : public App {
Timer update_timer = Timer(Timer::Type::Periodic, []() { onTimer(); });
Timer update_timer = Timer(Timer::Type::Periodic, kernel::millisToTicks(1000),[]() { onTimer(); });
std::shared_ptr<hal::power::PowerDevice> power;
@@ -180,7 +180,7 @@ public:
updateUi();
update_timer.start(kernel::millisToTicks(1000));
update_timer.start();
}
void onHide(TT_UNUSED AppContext& app) override {
@@ -8,6 +8,7 @@
#include <Tactility/app/App.h>
#include <Tactility/app/AppManifest.h>
#include <Tactility/kernel/Platform.h>
#include <Tactility/lvgl/Lvgl.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/lvgl/Toolbar.h>
@@ -71,7 +72,7 @@ static void onModeSetCallback(TT_UNUSED lv_event_t* event) {
}
ScreenshotApp::ScreenshotApp() {
updateTimer = std::make_unique<Timer>(Timer::Type::Periodic, [this]() {
updateTimer = std::make_unique<Timer>(Timer::Type::Periodic, 500 / portTICK_PERIOD_MS, [this] {
onTimerTick();
});
}
@@ -274,7 +275,7 @@ void ScreenshotApp::onShow(AppContext& appContext, lv_obj_t* parent) {
updateScreenshotMode();
if (!updateTimer->isRunning()) {
updateTimer->start(500 / portTICK_PERIOD_MS);
updateTimer->start();
}
}
@@ -283,7 +283,7 @@ static std::shared_ptr<SystemInfoApp> _Nullable optApp() {
}
class SystemInfoApp final : public App {
Timer memoryTimer = Timer(Timer::Type::Periodic, []() {
Timer memoryTimer = Timer(Timer::Type::Periodic, kernel::millisToTicks(10000), [] {
auto app = optApp();
if (app) {
auto lock = lvgl::getSyncLock()->asScopedLock();
@@ -293,7 +293,7 @@ class SystemInfoApp final : public App {
}
});
Timer tasksTimer = Timer(Timer::Type::Periodic, []() {
Timer tasksTimer = Timer(Timer::Type::Periodic, kernel::millisToTicks(15000), [] {
auto app = optApp();
if (app) {
auto lock = lvgl::getSyncLock()->asScopedLock();
@@ -688,8 +688,8 @@ class SystemInfoApp final : public App {
updatePsram(); // PSRAM: detailed breakdown
// Start timers (only run while app is visible, stopped in onHide)
memoryTimer.start(kernel::millisToTicks(10000)); // Memory & PSRAM: every 10s
tasksTimer.start(kernel::millisToTicks(15000)); // Tasks/CPU: every 15s
memoryTimer.start(); // Memory & PSRAM: every 10s
tasksTimer.start(); // Tasks/CPU: every 15s
}
void onHide(TT_UNUSED AppContext& app) override {
+3 -3
View File
@@ -7,9 +7,9 @@
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/service/loader/Loader.h>
#include <Tactility/Timer.h>
#include <Tactility/MountPoints.h>
#include <Tactility/StringUtils.h>
#include <Tactility/Timer.h>
#include <lvgl.h>
#include <memory>
@@ -82,7 +82,7 @@ class TimeZoneApp final : public App {
updateTimer->stop();
}
updateTimer->start(500 / portTICK_PERIOD_MS);
updateTimer->start();
mutex.unlock();
}
@@ -220,7 +220,7 @@ public:
}
void onCreate(AppContext& app) override {
updateTimer = std::make_unique<Timer>(Timer::Type::Once, [this] {
updateTimer = std::make_unique<Timer>(Timer::Type::Once, 500 / portTICK_PERIOD_MS, [this] {
updateList();
});
}