Module improvements: lvgl, gps, crypt (#585)
This commit is contained in:
committed by
GitHub
parent
ca5b071859
commit
db7468d0c8
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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,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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user