Merge develop into main (#312)

- Move various settings to `/data/settings` and `/sdcard/settings`
- Fix for `Gui` and `Statusbar` errors on startup (LVGL start)
- Implement Development service settings as properties file
- Rename `service::findManifestId()` to `service::findManifestById()`
- Renamed various classes like `BootProperties` to `BootSettings`
- Renamed `settings.properties` to `system.properties`. Code was moved to `settings` namespace/folder
- `DevelopmentSettings` is now in `settings` namespace/folder (moved from service)
This commit is contained in:
Ken Van Hoeylandt
2025-08-31 20:31:31 +02:00
committed by GitHub
parent 5dfc6d70da
commit 5cc5b50694
30 changed files with 449 additions and 331 deletions
@@ -1,19 +0,0 @@
#pragma once
#include <src/display/lv_display.h>
namespace tt::app::display {
void setBacklightDuty(uint8_t value);
bool getBacklightDuty(uint8_t& duty);
void setGammaCurve(uint8_t curveIndex);
bool getGammaCurve(uint8_t& curveIndex);
void setRotation(lv_display_rotation_t rotation);
lv_display_rotation_t getRotation();
} // namespace
@@ -40,7 +40,7 @@ State getState(const std::string& id);
* @param[in] id the id as defined in the manifest
* @return the matching manifest or nullptr when it wasn't found
*/
std::shared_ptr<const ServiceManifest> _Nullable findManifestId(const std::string& id);
std::shared_ptr<const ServiceManifest> _Nullable findManifestById(const std::string& id);
/** Find a ServiceContext by its manifest id.
* @param[in] id the id as defined in the manifest
@@ -2,9 +2,9 @@
#include <string>
namespace tt {
namespace tt::settings {
struct BootProperties {
struct BootSettings {
/** App to start automatically after the splash screen. */
std::string launcherAppId;
/** App to start automatically from the launcher screen. */
@@ -12,13 +12,13 @@ struct BootProperties {
};
/**
* Load the boot properties from the relevant file location(s).
* Load the boot properties file from the relevant file location(s).
* It will first attempt to load them from the SD card and if no file was found,
* then it will try to load the one from the data mount point.
*
* @param[out] properties the resulting properties
* @return true when the properties were successfully loaded and the result was set
*/
bool loadBootProperties(BootProperties& properties);
bool loadBootSettings(BootSettings& properties);
}
@@ -0,0 +1,32 @@
#pragma once
#include <src/display/lv_display.h>
namespace tt::settings::display {
enum class Orientation {
// In order of rotation (to make it easier to convert to LVGL rotation)
Landscape,
Portrait,
LandscapeFlipped,
PortraitFlipped,
};
struct DisplaySettings {
Orientation orientation;
uint8_t gammaCurve;
uint8_t backlightDuty;
};
/** Compares default settings with the function parameter to return the difference */
lv_display_rotation_t toLvglDisplayRotation(Orientation orientation);
bool load(DisplaySettings& settings);
DisplaySettings loadOrGetDefault();
DisplaySettings getDefault();
bool save(const DisplaySettings& settings);
} // namespace
@@ -1,16 +0,0 @@
#pragma once
#include "Language.h"
namespace tt::settings {
struct SettingsProperties {
Language language;
bool timeFormat24h;
};
bool loadSettingsProperties(SettingsProperties& properties);
bool saveSettingsProperties(const SettingsProperties& properties);
}
@@ -0,0 +1,16 @@
#pragma once
#include "Language.h"
namespace tt::settings {
struct SystemSettings {
Language language;
bool timeFormat24h;
};
bool loadSystemSettings(SystemSettings& properties);
bool saveSystemSettings(const SystemSettings& properties);
}