mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-04-18 09:25:06 +00:00
* **New Features** * BMI270 6-axis IMU driver added; new unified filesystem abstraction for mounted filesystems. * Public Wi‑Fi API surface (no implementation yet) * SDMMC driver added (kernel drive$) * expanded GPIO interrupt/callback support * **Improvements** * M5Stack Tab5: revamped GPIO/power initialization and IMU integration. * LVGL updates including device fontSize configuration. * Updated all code related to SD card device/fs handling * Rename LilyGO T-HMI S3 to LilyGO T-HMI * **Bug Fixes** * Simplified and consolidated SD card handling and mount discovery.
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
#include <Tactility/MountPoints.h>
|
|
#include <Tactility/file/File.h>
|
|
#include <Tactility/file/PropertiesFile.h>
|
|
#include <Tactility/hal/sdcard/SdCardDevice.h>
|
|
#include <Tactility/Logger.h>
|
|
#include <Tactility/settings/BootSettings.h>
|
|
|
|
#include <Tactility/Paths.h>
|
|
#include <format>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace tt::settings {
|
|
|
|
constexpr auto* TAG = "BootSettings";
|
|
|
|
constexpr auto* PROPERTIES_FILE_FORMAT = "{}/settings/boot.properties";
|
|
constexpr auto* PROPERTIES_KEY_LAUNCHER_APP_ID = "launcherAppId";
|
|
constexpr auto* PROPERTIES_KEY_AUTO_START_APP_ID = "autoStartAppId";
|
|
|
|
static std::string getPropertiesFilePath() {
|
|
std::string sdcard_path;
|
|
if (findFirstMountedSdCardPath(sdcard_path)) {
|
|
std::string path = std::format(PROPERTIES_FILE_FORMAT, sdcard_path);
|
|
if (file::isFile(path)) {
|
|
return path;
|
|
}
|
|
}
|
|
return std::format(PROPERTIES_FILE_FORMAT, file::MOUNT_POINT_DATA);
|
|
}
|
|
|
|
bool loadBootSettings(BootSettings& properties) {
|
|
const std::string path = getPropertiesFilePath();
|
|
if (!file::loadPropertiesFile(path, [&properties](auto& key, auto& value) {
|
|
if (key == PROPERTIES_KEY_AUTO_START_APP_ID) {
|
|
properties.autoStartAppId = value;
|
|
} else if (key == PROPERTIES_KEY_LAUNCHER_APP_ID) {
|
|
properties.launcherAppId = value;
|
|
}
|
|
})) {
|
|
LOG_I(TAG, "No settings at %s", path.c_str());
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
}
|