Merge develop into main (#368)
New boards: - LilyGO T-Dongle S3 - M5Stack StickC Plus - M5Stack StickC Plus2 New drivers: - AXP192: power control via I2C - ButtonControl: GPIO button input as LVGL device Other changes: - Updated implementation of AXP192 driver for Core2 board - Fix launcher UX for vertical layout - Fix error when properties file had an empty line - Add `__floatsidf` to `tt_init.cpp`
This commit is contained in:
committed by
GitHub
parent
3a59540365
commit
d8346998ce
@@ -26,7 +26,7 @@ bool loadPropertiesFile(const std::string& filePath, std::function<void(const st
|
||||
line_count++;
|
||||
std::string key, value;
|
||||
auto trimmed_line = string::trim(line, " \t");
|
||||
if (!trimmed_line.starts_with("#")) {
|
||||
if (!trimmed_line.starts_with("#") && !trimmed_line.empty()) {
|
||||
if (trimmed_line.starts_with("[")) {
|
||||
key_prefix = trimmed_line;
|
||||
} else {
|
||||
@@ -49,20 +49,22 @@ bool loadPropertiesFile(const std::string& filePath, std::map<std::string, std::
|
||||
}
|
||||
|
||||
bool savePropertiesFile(const std::string& filePath, const std::map<std::string, std::string>& properties) {
|
||||
return file::withLock<bool>(filePath, [filePath, &properties] {
|
||||
bool result = false;
|
||||
getLock(filePath)->withLock([&result, filePath, &properties] {
|
||||
TT_LOG_I(TAG, "Saving properties file %s", filePath.c_str());
|
||||
|
||||
FILE* file = fopen(filePath.c_str(), "w");
|
||||
if (file == nullptr) {
|
||||
TT_LOG_E(TAG, "Failed to open %s", filePath.c_str());
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto& [key, value]: properties) { fprintf(file, "%s=%s\n", key.c_str(), value.c_str()); }
|
||||
|
||||
fclose(file);
|
||||
return true;
|
||||
result = true;
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user