Feature: Custom user set charging cap

This commit is contained in:
John
2023-05-28 21:12:00 +02:00
parent 32fad4af8d
commit 8becdc66e7
7 changed files with 51 additions and 1 deletions
+1
Submodule lib/STM32CubeWB added at a9e29b431f
+4
View File
@@ -30,6 +30,7 @@ XtremeSettings xtreme_settings = {
.bad_bt_remember = false, // OFF
.butthurt_timer = 21600, // 6 H
.rgb_backlight = false, // OFF
.charge_cap = 100, // 100%
};
void XTREME_SETTINGS_LOAD() {
@@ -91,6 +92,8 @@ void XTREME_SETTINGS_LOAD() {
flipper_format_read_int32(file, "butthurt_timer", &x->butthurt_timer, 1);
flipper_format_rewind(file);
flipper_format_read_bool(file, "rgb_backlight", &x->rgb_backlight, 1);
flipper_format_rewind(file);
flipper_format_read_uint32(file, "charge_cap", &x->charge_cap, 1);
}
flipper_format_free(file);
furi_record_close(RECORD_STORAGE);
@@ -127,6 +130,7 @@ void XTREME_SETTINGS_SAVE() {
flipper_format_write_bool(file, "bad_bt_remember", &x->bad_bt_remember, 1);
flipper_format_write_int32(file, "butthurt_timer", &x->butthurt_timer, 1);
flipper_format_write_bool(file, "rgb_backlight", &x->rgb_backlight, 1);
flipper_format_write_uint32(file, "charge_cap", &x->charge_cap, 1);
}
flipper_format_free(file);
furi_record_close(RECORD_STORAGE);
+1
View File
@@ -38,6 +38,7 @@ typedef struct {
bool bad_bt_remember;
int32_t butthurt_timer;
bool rgb_backlight;
uint32_t charge_cap;
} XtremeSettings;
void XTREME_SETTINGS_SAVE();