mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-17 04:34:44 -07:00
fbt format and naming fix
This commit is contained in:
@@ -151,7 +151,8 @@ static bool desktop_custom_event_callback(void* context, uint32_t event) {
|
||||
} else if(event == DesktopGlobalAutoLock) {
|
||||
if(!desktop->app_running && !desktop->locked) {
|
||||
// if usb_inhibit_autolock enabled and device charging or device charged but still connected to USB then break desktop locking.
|
||||
if ((desktop->settings.usb_inhibit_auto_lock == USB_INHIBIT_AUTOLOCK_ON) && ((furi_hal_power_is_charging()) || (furi_hal_power_is_charging_done()))){
|
||||
if((desktop->settings.usb_inhibit_auto_lock == USB_INHIBIT_AUTOLOCK_ON) &&
|
||||
((furi_hal_power_is_charging()) || (furi_hal_power_is_charging_done()))) {
|
||||
return (0);
|
||||
}
|
||||
// if usb_inhibit_autolock set to RPC and we have F0 connected to phone or PC app then break desktop locking.
|
||||
|
||||
@@ -444,8 +444,7 @@ static void power_auto_poweroff_timer_callback(void* context) {
|
||||
//poweroff if not charging now or if connected to charger and charging done
|
||||
if(((!furi_hal_power_is_charging())) || (furi_hal_power_is_charging_done())) {
|
||||
power_off(power);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
//else we dont poweroff device and restart timer
|
||||
FURI_LOG_D(TAG, "We dont auto_power_off until battery is charging");
|
||||
power_start_auto_poweroff_timer(power);
|
||||
|
||||
@@ -33,7 +33,9 @@ void power_settings_load(PowerSettings* settings) {
|
||||
POWER_SETTINGS_MAGIC,
|
||||
POWER_SETTINGS_VER);
|
||||
|
||||
} else if(version == POWER_SETTINGS_VER_0) { // if config previous version - load it and manual set new settings to inital value
|
||||
} else if(
|
||||
version ==
|
||||
POWER_SETTINGS_VER_0) { // if config previous version - load it and manual set new settings to inital value
|
||||
PowerSettingsV0* settings_v0 = malloc(sizeof(PowerSettingsV0));
|
||||
|
||||
success = saved_struct_load(
|
||||
|
||||
@@ -104,7 +104,6 @@ static void desktop_settings_scene_start_clock_enable_changed(VariableItem* item
|
||||
app->settings.display_clock = index;
|
||||
}
|
||||
|
||||
|
||||
static void desktop_settings_scene_start_auto_lock_delay_changed(VariableItem* item) {
|
||||
DesktopSettingsApp* app = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
@@ -151,7 +150,9 @@ void desktop_settings_scene_start_on_enter(void* context) {
|
||||
app);
|
||||
|
||||
value_index = value_index_uint32(
|
||||
app->settings.usb_inhibit_auto_lock, usb_inhibit_auto_lock_delay_value, USB_INHIBIT_AUTO_LOCK_DELAY_COUNT);
|
||||
app->settings.usb_inhibit_auto_lock,
|
||||
usb_inhibit_auto_lock_delay_value,
|
||||
USB_INHIBIT_AUTO_LOCK_DELAY_COUNT);
|
||||
variable_item_set_current_value_index(item, value_index);
|
||||
variable_item_set_current_value_text(item, usb_inhibit_auto_lock_delay_text[value_index]);
|
||||
|
||||
|
||||
@@ -48,7 +48,9 @@ PowerSettingsApp* power_settings_app_alloc(uint32_t first_scene) {
|
||||
app->view_dispatcher, PowerSettingsAppViewSubmenu, submenu_get_view(app->submenu));
|
||||
app->variable_item_list = variable_item_list_alloc();
|
||||
view_dispatcher_add_view(
|
||||
app->view_dispatcher, PowerSettingsAppViewVariableItemList, variable_item_list_get_view(app->variable_item_list));
|
||||
app->view_dispatcher,
|
||||
PowerSettingsAppViewVariableItemList,
|
||||
variable_item_list_get_view(app->variable_item_list));
|
||||
app->dialog = dialog_ex_alloc();
|
||||
view_dispatcher_add_view(
|
||||
app->view_dispatcher, PowerSettingsAppViewDialog, dialog_ex_get_view(app->dialog));
|
||||
|
||||
@@ -24,7 +24,9 @@ static void power_settings_scene_start_auto_poweroff_delay_changed(VariableItem*
|
||||
app->settings.auto_poweroff_delay_ms = auto_poweroff_delay_value[index];
|
||||
}
|
||||
|
||||
static void power_settings_scene_start_submenu_callback(void* context, uint32_t index) { //show selected menu screen
|
||||
static void power_settings_scene_start_submenu_callback(
|
||||
void* context,
|
||||
uint32_t index) { //show selected menu screen
|
||||
furi_assert(context);
|
||||
PowerSettingsApp* app = context;
|
||||
view_dispatcher_send_custom_event(app->view_dispatcher, index);
|
||||
@@ -42,7 +44,7 @@ void power_settings_scene_start_on_enter(void* context) {
|
||||
uint8_t value_index;
|
||||
item = variable_item_list_add(
|
||||
variable_item_list,
|
||||
"Auto PowerOff Time",
|
||||
"Auto PowerOff",
|
||||
AUTO_POWEROFF_DELAY_COUNT,
|
||||
power_settings_scene_start_auto_poweroff_delay_changed, //function for change visible item list value and app settings
|
||||
app);
|
||||
@@ -55,9 +57,12 @@ void power_settings_scene_start_on_enter(void* context) {
|
||||
variable_item_set_current_value_text(item, auto_poweroff_delay_text[value_index]);
|
||||
|
||||
variable_item_list_set_selected_item(
|
||||
variable_item_list, scene_manager_get_scene_state(app->scene_manager, PowerSettingsAppSceneStart));
|
||||
variable_item_list,
|
||||
scene_manager_get_scene_state(app->scene_manager, PowerSettingsAppSceneStart));
|
||||
variable_item_list_set_enter_callback( //callback to show next mennu screen
|
||||
variable_item_list, power_settings_scene_start_submenu_callback, app);
|
||||
variable_item_list,
|
||||
power_settings_scene_start_submenu_callback,
|
||||
app);
|
||||
|
||||
view_dispatcher_switch_to_view(app->view_dispatcher, PowerSettingsAppViewVariableItemList);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user