mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-09 23:18:10 -07:00
Feature: Custom user set charging cap
This commit is contained in:
Submodule
+1
Submodule lib/STM32CubeWB added at a9e29b431f
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user