Module improvements: lvgl, gps, crypt (#585)

This commit is contained in:
Ken Van Hoeylandt
2026-07-25 23:04:39 +02:00
committed by GitHub
parent ca5b071859
commit db7468d0c8
92 changed files with 261 additions and 271 deletions
+3 -3
View File
@@ -20,11 +20,12 @@
#include <Tactility/service/audio/Audio.h>
#include <Tactility/settings/TimePrivate.h>
#include <gps/gps_module.h>
#include <gps/module.h>
#include <gps_generic/gps_generic_module.h>
#include <crypt/module.h>
#include <lvgl/module.h>
#include <tactility/concurrent/thread.h>
#include <tactility/crypt_module.h>
#include <tactility/drivers/audio_stream.h>
#include <tactility/drivers/display.h>
#include <tactility/drivers/grove.h>
@@ -34,7 +35,6 @@
#include <tactility/filesystem/file_system.h>
#include <tactility/kernel_init.h>
#include <tactility/log.h>
#include <tactility/lvgl_module.h>
#ifdef ESP_PLATFORM
#include <Tactility/InitEsp.h>
+1 -1
View File
@@ -6,7 +6,7 @@
#include <tactility/drivers/uart_controller.h>
#include <tactility/log.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
#include <gps/gps.h>
#include <gps/gps_settings.h>
+1 -1
View File
@@ -12,7 +12,7 @@
#include <lvgl.h>
#include <tactility/log.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
#include <algorithm>
#include <format>
+2 -2
View File
@@ -5,8 +5,8 @@
#include <lvgl.h>
#include <algorithm>
#include <tactility/lvgl_fonts.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_fonts.h>
#include <lvgl/lvgl_icon_shared.h>
namespace tt::app::applist {
@@ -1,5 +1,5 @@
#include <tactility/lvgl_fonts.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_fonts.h>
#include <lvgl/lvgl_icon_shared.h>
#include <Tactility/app/AppRegistration.h>
#include <Tactility/app/appdetails/AppDetails.h>
@@ -1,6 +1,6 @@
#include <Tactility/Tactility.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
#include <Tactility/PubSub.h>
#include <Tactility/app/App.h>
@@ -10,7 +10,7 @@
#include <Tactility/service/audio/Audio.h>
#include <lvgl.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
namespace tt::app::audiosettings {
+1 -1
View File
@@ -8,7 +8,7 @@
#include <Tactility/lvgl/LvglSync.h>
#include <tactility/log.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
namespace tt::app::btmanage {
+1 -1
View File
@@ -1,7 +1,7 @@
#include <format>
#include <string>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
#include <Tactility/app/btmanage/View.h>
#include <Tactility/app/btmanage/BtManagePrivate.h>
+1 -1
View File
@@ -14,7 +14,7 @@
#include <cctype>
#include <cstdlib>
#include <tactility/log.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
#include <vector>
namespace tt::app::chat {
+1 -1
View File
@@ -11,7 +11,7 @@
#include <Tactility/file/PropertiesFile.h>
#include <Tactility/Paths.h>
#include <tactility/crypt.h>
#include <crypt/crypt.h>
#include <esp_random.h>
@@ -12,8 +12,8 @@
#include <Tactility/service/wifi/Wifi.h>
#include <tactility/log.h>
#include <tactility/lvgl_icon_shared.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl_icon_shared.h>
#include <lvgl/lvgl.h>
#include <cstring>
#include <lvgl.h>
@@ -31,11 +31,10 @@ class DevelopmentApp final : public App {
std::shared_ptr<service::development::DevelopmentService> service;
Timer timer = Timer(Timer::Type::Periodic, pdMS_TO_TICKS(1000), [this] {
auto lockable = lvgl::getSyncLock();
auto lock = lockable->asScopedLock();
// TODO: There's a crash when this is called when the app is being destroyed
if (lock.lock(lvgl::defaultLockTime) && module_is_started(&lvgl_module)) {
if (lvgl_is_running()) {
lvgl_lock();
updateViewState();
lvgl_unlock();
}
});
@@ -158,11 +157,10 @@ public:
}
void onHide(AppContext& appContext) override {
auto lockable = lvgl::getSyncLock();
auto lock = lockable->asScopedLock();
lvgl_lock();
// Ensure that the update isn't already happening
lock.lock();
timer.stop();
lvgl_unlock();
}
};
@@ -1,19 +1,13 @@
#include "tactility/lvgl_module.h"
#include <lvgl/lvgl.h>
#include <lvgl/lvgl_icon_shared.h>
#include <Tactility/Tactility.h>
#include <Tactility/Timer.h>
#include <Tactility/app/AppManifest.h>
#include <Tactility/app/alertdialog/AlertDialog.h>
#include <Tactility/lvgl/LvglSync.h>
#include <Tactility/lvgl/Toolbar.h>
#include <tactility/device.h>
#include <tactility/lvgl_icon_shared.h>
#include <atomic>
#include <cstring>
@@ -181,38 +175,35 @@ class GpsSettingsApp final : public App {
}
void updateDeviceStates() {
auto lockable = lvgl::getSyncLock();
auto lock = lockable->asScopedLock();
if (lock.lock(100 / portTICK_PERIOD_MS)) {
for (auto& row : deviceRows) {
const char* text = "Start";
bool enabled = true;
lvgl_lock();
for (const auto& row : deviceRows) {
const char* text = "Start";
bool enabled = true;
if (device_is_ready(row.device)) {
switch (gps_get_state(row.device)) {
case GPS_STATE_PENDING_ON:
text = "Starting...";
enabled = false;
break;
case GPS_STATE_PENDING_OFF:
text = "Stopping...";
enabled = false;
break;
default:
text = "Stop";
enabled = true;
break;
}
}
lv_label_set_text(row.buttonLabel, text);
if (enabled) {
lv_obj_remove_state(row.button, LV_STATE_DISABLED);
} else {
lv_obj_add_state(row.button, LV_STATE_DISABLED);
if (device_is_ready(row.device)) {
switch (gps_get_state(row.device)) {
case GPS_STATE_PENDING_ON:
text = "Starting...";
enabled = false;
break;
case GPS_STATE_PENDING_OFF:
text = "Stopping...";
enabled = false;
break;
default:
text = "Stop";
enabled = true;
break;
}
}
lv_label_set_text(row.buttonLabel, text);
if (enabled) {
lv_obj_remove_state(row.button, LV_STATE_DISABLED);
} else {
lv_obj_add_state(row.button, LV_STATE_DISABLED);
}
}
lvgl_unlock();
}
public:
@@ -4,7 +4,7 @@
#include <tactility/device.h>
#include <tactility/drivers/grove.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
#include <Tactility/Tactility.h>
#include <Tactility/lvgl/Toolbar.h>
@@ -14,7 +14,7 @@
#include <format>
#include <tactility/log.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
namespace tt::app::i2cscanner {
@@ -1,10 +1,10 @@
#include <tactility/drivers/display.h>
#include <tactility/error.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
#include <tactility/device.h>
#include <tactility/drivers/backlight.h>
#include <tactility/log.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
#include <Tactility/Tactility.h>
#ifdef ESP_PLATFORM
@@ -7,7 +7,7 @@
#include <tactility/device.h>
#include <tactility/drivers/backlight.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
#include <lvgl.h>
+3 -3
View File
@@ -13,9 +13,9 @@
#include <tactility/device.h>
#include <tactility/drivers/power_supply.h>
#include <tactility/log.h>
#include <tactility/lvgl_fonts.h>
#include <tactility/lvgl_icon_launcher.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl_fonts.h>
#include <lvgl/lvgl_icon_launcher.h>
#include <lvgl/lvgl.h>
namespace tt::app::launcher {
@@ -8,7 +8,7 @@
#include <Tactility/settings/Language.h>
#include <Tactility/settings/SystemSettings.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
#include <lvgl.h>
#include <map>
+1 -1
View File
@@ -9,7 +9,7 @@
#include <lvgl.h>
#include <tactility/log.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
namespace tt::app::notes {
+1 -1
View File
@@ -8,7 +8,7 @@
#include <tactility/device.h>
#include <tactility/drivers/power_supply.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
#include <lvgl.h>
+2 -2
View File
@@ -9,8 +9,8 @@
#include <lvgl.h>
#include <tactility/device.h>
#include <tactility/drivers/power_supply.h>
#include <tactility/lvgl_fonts.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_fonts.h>
#include <lvgl/lvgl_icon_shared.h>
namespace tt::app::poweroff {
@@ -15,7 +15,7 @@
#include <Tactility/Timer.h>
#include <tactility/log.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
namespace tt::app::screenshot {
+2 -2
View File
@@ -3,8 +3,8 @@
#include <Tactility/service/loader/Loader.h>
#include <tactility/check.h>
#include <tactility/lvgl_icon_shared.h>
#include <tactility/lvgl_fonts.h>
#include <lvgl/lvgl_icon_shared.h>
#include <lvgl/lvgl_fonts.h>
#include <lvgl.h>
+2 -2
View File
@@ -1,5 +1,5 @@
#include <tactility/lvgl_fonts.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl_fonts.h>
#include <lvgl/lvgl.h>
#include <Tactility/app/App.h>
#include <Tactility/app/AppManifest.h>
@@ -11,9 +11,9 @@
#include <lvgl.h>
#include <utility>
#include <tactility/lvgl_fonts.h>
#include <tactility/lvgl_icon_shared.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl_fonts.h>
#include <lvgl/lvgl_icon_shared.h>
#include <lvgl/lvgl.h>
#ifdef ESP_PLATFORM
#include <esp_vfs_fat.h>
@@ -1,4 +1,4 @@
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
#include <Tactility/RecursiveMutex.h>
@@ -13,7 +13,7 @@
#include <lvgl.h>
#include <tactility/log.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
namespace tt::app::timedatesettings {
+2 -2
View File
@@ -1,5 +1,5 @@
#include <tactility/lvgl_fonts.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_fonts.h>
#include <lvgl/lvgl_icon_shared.h>
#include <Tactility/app/AppContext.h>
#include <Tactility/app/AppManifest.h>
@@ -6,8 +6,8 @@
#include <Tactility/settings/TouchCalibrationSettings.h>
#include <tactility/log.h>
#include <tactility/lvgl_module.h>
#include <tactility/lvgl_pointer.h>
#include <lvgl/lvgl.h>
#include <lvgl/lvgl_pointer.h>
#include <algorithm>
#include <lvgl.h>
@@ -2,8 +2,8 @@
#include <lvgl.h>
#include <tactility/lvgl_icon_shared.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl_icon_shared.h>
#include <lvgl/lvgl.h>
#include <Tactility/Tactility.h>
#include <Tactility/settings/TrackballSettings.h>
@@ -5,7 +5,7 @@
#include <lvgl.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
#define TAG "usb_settings"
@@ -12,7 +12,7 @@
#include <lvgl.h>
#include <tactility/log.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
#include <esp_netif.h>
#include <esp_wifi.h>
+1 -1
View File
@@ -12,7 +12,7 @@
#include <Tactility/Tactility.h>
#include <tactility/log.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
namespace tt::app::wifimanage {
@@ -9,7 +9,7 @@
#include <Tactility/service/loader/Loader.h>
#include <tactility/log.h>
#include <tactility/lvgl_icon_shared.h>
#include <lvgl/lvgl_icon_shared.h>
namespace tt::app::wifimanage {
+1 -1
View File
@@ -3,7 +3,7 @@
#include <tactility/drivers/spi_controller.h>
#include <tactility/filesystem/file_mutex.h>
#include <tactility/filesystem/file_system.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
constexpr auto* TAG = "file_mutex_lvgl";
+1 -1
View File
@@ -1,7 +1,7 @@
#include "Tactility/lvgl/LvglSync.h"
#include <Tactility/Mutex.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
namespace tt::lvgl {
+1 -1
View File
@@ -2,7 +2,7 @@
#include <Tactility/lvgl/SliderBox.h>
#include <tactility/lvgl_fonts.h>
#include <lvgl/lvgl_fonts.h>
namespace tt::lvgl {
+2 -2
View File
@@ -12,8 +12,8 @@
#include <tactility/check.h>
#include <tactility/log.h>
#include <tactility/lvgl_fonts.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl_fonts.h>
#include <lvgl/lvgl.h>
#include <lvgl.h>
#include <memory>
+2 -2
View File
@@ -9,8 +9,8 @@
#include <Tactility/service/loader/Loader.h>
#include <tactility/check.h>
#include <tactility/lvgl_fonts.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl_fonts.h>
#include <lvgl/lvgl.h>
namespace tt::lvgl {
+1 -1
View File
@@ -2,7 +2,7 @@
#include <lvgl.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
extern "C" {
+1 -1
View File
@@ -2,7 +2,7 @@
#include <lvgl.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
extern "C" {
+1 -1
View File
@@ -2,7 +2,7 @@
#include <lvgl.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
extern "C" {
+1 -1
View File
@@ -2,7 +2,7 @@
#include <lvgl.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
extern "C" {
+1 -1
View File
@@ -2,7 +2,7 @@
#include <lvgl.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
extern "C" {
+1 -1
View File
@@ -2,7 +2,7 @@
#include <lvgl.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
#include <Tactility/service/gui/GuiService.h>
@@ -16,7 +16,7 @@
#include <tactility/log.h>
#include <tactility/drivers/display.h>
#include <tactility/drivers/backlight.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
namespace tt::service::displayidle {
+1 -1
View File
@@ -12,7 +12,7 @@
#include <Tactility/service/loader/Loader.h>
#include <tactility/log.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
namespace tt::service::gui {
@@ -12,7 +12,7 @@
#include <tactility/device.h>
#include <tactility/drivers/backlight.h>
#include <tactility/drivers/keyboard.h>
#include <tactility/lvgl_module.h>
#include <lvgl/lvgl.h>
namespace tt::service::keyboardidle {
@@ -3,7 +3,7 @@
#include <Tactility/service/ServiceManifest.h>
#include <Tactility/service/memorychecker/MemoryCheckerService.h>
#include <tactility/lvgl_icon_statusbar.h>
#include <lvgl/lvgl_icon_statusbar.h>
#include <tactility/log.h>
namespace tt::service::memorychecker {
@@ -22,8 +22,8 @@
#include <tactility/log.h>
#include <tactility/module.h>
#include <tactility/lvgl_module.h>
#include <tactility/lvgl_icon_statusbar.h>
#include <lvgl/lvgl.h>
#include <lvgl/lvgl_icon_statusbar.h>
#include <cstring>
@@ -268,8 +268,8 @@ class StatusbarService final : public Service {
}
void update() {
if (module_is_started(&lvgl_module)) {
if (lvgl_try_lock(100)) {
if (lvgl_is_running()) {
if (lvgl_try_lock(200)) {
updateGpsIcon();
updateBluetoothIcon();
updateWifiIcon();
@@ -30,7 +30,7 @@
#include <lv_screenshot.h>
#endif
#include <tactility/lvgl_icon_statusbar.h>
#include <lvgl/lvgl_icon_statusbar.h>
#include <atomic>
#include <cctype>
@@ -4,7 +4,7 @@
#include <Tactility/file/File.h>
#include <tactility/crypt.h>
#include <crypt/crypt.h>
#include <Tactility/service/ServicePaths.h>