1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 13:09:49 +04:00

fbt format and naming fix

This commit is contained in:
MX
2025-01-15 17:23:38 +03:00
parent 8872b13d54
commit 633f5d7c57
9 changed files with 46 additions and 36 deletions

View File

@@ -151,7 +151,8 @@ static bool desktop_custom_event_callback(void* context, uint32_t event) {
} else if(event == DesktopGlobalAutoLock) { } else if(event == DesktopGlobalAutoLock) {
if(!desktop->app_running && !desktop->locked) { 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 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); return (0);
} }
// if usb_inhibit_autolock set to RPC and we have F0 connected to phone or PC app then break desktop locking. // if usb_inhibit_autolock set to RPC and we have F0 connected to phone or PC app then break desktop locking.

View File

@@ -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 //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())) { if(((!furi_hal_power_is_charging())) || (furi_hal_power_is_charging_done())) {
power_off(power); power_off(power);
} } else {
else {
//else we dont poweroff device and restart timer //else we dont poweroff device and restart timer
FURI_LOG_D(TAG, "We dont auto_power_off until battery is charging"); FURI_LOG_D(TAG, "We dont auto_power_off until battery is charging");
power_start_auto_poweroff_timer(power); power_start_auto_poweroff_timer(power);

View File

@@ -33,7 +33,9 @@ void power_settings_load(PowerSettings* settings) {
POWER_SETTINGS_MAGIC, POWER_SETTINGS_MAGIC,
POWER_SETTINGS_VER); 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)); PowerSettingsV0* settings_v0 = malloc(sizeof(PowerSettingsV0));
success = saved_struct_load( success = saved_struct_load(

View File

@@ -104,7 +104,6 @@ static void desktop_settings_scene_start_clock_enable_changed(VariableItem* item
app->settings.display_clock = index; app->settings.display_clock = index;
} }
static void desktop_settings_scene_start_auto_lock_delay_changed(VariableItem* item) { static void desktop_settings_scene_start_auto_lock_delay_changed(VariableItem* item) {
DesktopSettingsApp* app = variable_item_get_context(item); DesktopSettingsApp* app = variable_item_get_context(item);
uint8_t index = variable_item_get_current_value_index(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); app);
value_index = value_index_uint32( 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_index(item, value_index);
variable_item_set_current_value_text(item, usb_inhibit_auto_lock_delay_text[value_index]); variable_item_set_current_value_text(item, usb_inhibit_auto_lock_delay_text[value_index]);

View File

@@ -48,7 +48,9 @@ PowerSettingsApp* power_settings_app_alloc(uint32_t first_scene) {
app->view_dispatcher, PowerSettingsAppViewSubmenu, submenu_get_view(app->submenu)); app->view_dispatcher, PowerSettingsAppViewSubmenu, submenu_get_view(app->submenu));
app->variable_item_list = variable_item_list_alloc(); app->variable_item_list = variable_item_list_alloc();
view_dispatcher_add_view( 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(); app->dialog = dialog_ex_alloc();
view_dispatcher_add_view( view_dispatcher_add_view(
app->view_dispatcher, PowerSettingsAppViewDialog, dialog_ex_get_view(app->dialog)); app->view_dispatcher, PowerSettingsAppViewDialog, dialog_ex_get_view(app->dialog));

View File

@@ -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]; 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); furi_assert(context);
PowerSettingsApp* app = context; PowerSettingsApp* app = context;
view_dispatcher_send_custom_event(app->view_dispatcher, index); 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; uint8_t value_index;
item = variable_item_list_add( item = variable_item_list_add(
variable_item_list, variable_item_list,
"Auto PowerOff Time", "Auto PowerOff",
AUTO_POWEROFF_DELAY_COUNT, AUTO_POWEROFF_DELAY_COUNT,
power_settings_scene_start_auto_poweroff_delay_changed, //function for change visible item list value and app settings power_settings_scene_start_auto_poweroff_delay_changed, //function for change visible item list value and app settings
app); 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_set_current_value_text(item, auto_poweroff_delay_text[value_index]);
variable_item_list_set_selected_item( 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_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); view_dispatcher_switch_to_view(app->view_dispatcher, PowerSettingsAppViewVariableItemList);
} }