Revert "Revert "Feature: Custom user set charging cap (#265)""

This reverts commit 31f624d662.
This commit is contained in:
Willy-JL
2023-05-31 17:33:05 +01:00
parent 4c86f7b2fb
commit a3b4defa44
5 changed files with 47 additions and 0 deletions
+4
View File
@@ -29,6 +29,7 @@ XtremeSettings xtreme_settings = {
.bad_bt = false, // USB
.bad_bt_remember = false, // OFF
.butthurt_timer = 21600, // 6 H
.charge_cap = 100, // 100%
.rgb_backlight = false, // OFF
};
@@ -90,6 +91,8 @@ void XTREME_SETTINGS_LOAD() {
flipper_format_rewind(file);
flipper_format_read_int32(file, "butthurt_timer", &x->butthurt_timer, 1);
flipper_format_rewind(file);
flipper_format_read_uint32(file, "charge_cap", &x->charge_cap, 1);
flipper_format_rewind(file);
flipper_format_read_bool(file, "rgb_backlight", &x->rgb_backlight, 1);
}
flipper_format_free(file);
@@ -126,6 +129,7 @@ void XTREME_SETTINGS_SAVE() {
flipper_format_write_bool(file, "bad_bt", &x->bad_bt, 1);
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_uint32(file, "charge_cap", &x->charge_cap, 1);
flipper_format_write_bool(file, "rgb_backlight", &x->rgb_backlight, 1);
}
flipper_format_free(file);
+1
View File
@@ -37,6 +37,7 @@ typedef struct {
bool bad_bt;
bool bad_bt_remember;
int32_t butthurt_timer;
uint32_t charge_cap;
bool rgb_backlight;
} XtremeSettings;