Option to disable poweroff while locked --nobuild

This commit is contained in:
Willy-JL
2023-12-01 23:02:23 +00:00
parent d16ac1f73d
commit e2df487c63
4 changed files with 28 additions and 1 deletions
+6
View File
@@ -15,6 +15,7 @@ XtremeSettings xtreme_settings = {
.lock_on_boot = false, // OFF
.bad_pins_format = false, // OFF
.allow_locked_rpc_commands = false, // OFF
.lockscreen_poweroff = true, // ON
.lockscreen_time = true, // ON
.lockscreen_seconds = false, // OFF
.lockscreen_date = true, // ON
@@ -89,6 +90,10 @@ void XTREME_SETTINGS_LOAD() {
x->lock_on_boot = b;
}
flipper_format_rewind(file);
if(flipper_format_read_bool(file, "lockscreen_poweroff", &b, 1)) {
x->lockscreen_poweroff = b;
}
flipper_format_rewind(file);
if(flipper_format_read_bool(file, "lockscreen_time", &b, 1)) {
x->lockscreen_time = b;
}
@@ -216,6 +221,7 @@ void XTREME_SETTINGS_SAVE() {
flipper_format_write_bool(
file, "allow_locked_rpc_commands", &x->allow_locked_rpc_commands, 1);
flipper_format_write_bool(file, "lock_on_boot", &x->lock_on_boot, 1);
flipper_format_write_bool(file, "lockscreen_poweroff", &x->lockscreen_poweroff, 1);
flipper_format_write_bool(file, "lockscreen_time", &x->lockscreen_time, 1);
flipper_format_write_bool(file, "lockscreen_seconds", &x->lockscreen_seconds, 1);
flipper_format_write_bool(file, "lockscreen_date", &x->lockscreen_date, 1);
+1
View File
@@ -62,6 +62,7 @@ typedef struct {
bool lock_on_boot;
bool bad_pins_format;
bool allow_locked_rpc_commands;
bool lockscreen_poweroff;
bool lockscreen_time;
bool lockscreen_seconds;
bool lockscreen_date;