From add2bc9828aff5df45f82c59f894dfc47a3b7f1d Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Tue, 28 Mar 2023 07:54:56 +0100 Subject: [PATCH] Format --- .../scenes/xtreme_app_scene_start.c | 5 +- applications/main/xtreme_app/xtreme_app.c | 16 +++--- .../desktop/views/desktop_view_slideshow.c | 54 +++++++++---------- scripts/update.py | 5 +- 4 files changed, 41 insertions(+), 39 deletions(-) diff --git a/applications/main/xtreme_app/scenes/xtreme_app_scene_start.c b/applications/main/xtreme_app/scenes/xtreme_app_scene_start.c index 9b3179a0e..fabd7ce6c 100644 --- a/applications/main/xtreme_app/scenes/xtreme_app_scene_start.c +++ b/applications/main/xtreme_app/scenes/xtreme_app_scene_start.c @@ -48,7 +48,10 @@ bool xtreme_app_scene_start_on_event(void* context, SceneManagerEvent event) { scene_manager_next_scene(app->scene_manager, XtremeAppSceneMisc); break; case VarItemListIndexVersion: { - if(storage_common_copy(furi_record_open(RECORD_STORAGE), EXT_PATH("dolphin/xfwfirstboot.bin"), EXT_PATH(".slideshow"))) { + if(storage_common_copy( + furi_record_open(RECORD_STORAGE), + EXT_PATH("dolphin/xfwfirstboot.bin"), + EXT_PATH(".slideshow"))) { app->show_slideshow = true; xtreme_app_apply(app); } diff --git a/applications/main/xtreme_app/xtreme_app.c b/applications/main/xtreme_app/xtreme_app.c index 6ae904d77..005d4ece1 100644 --- a/applications/main/xtreme_app/xtreme_app.c +++ b/applications/main/xtreme_app/xtreme_app.c @@ -35,7 +35,7 @@ bool xtreme_app_apply(XtremeApp* app) { break; if(!flipper_format_write_header_cstr( - file, SUBGHZ_SETTING_FILE_TYPE, SUBGHZ_SETTING_FILE_VERSION)) + file, SUBGHZ_SETTING_FILE_TYPE, SUBGHZ_SETTING_FILE_VERSION)) break; while(flipper_format_delete_key(file, "Add_standard_frequencies")) @@ -57,10 +57,7 @@ bool xtreme_app_apply(XtremeApp* app) { ; for(uint i = 0; i < FrequencyList_size(app->subghz_hopper_freqs); i++) { flipper_format_write_uint32( - file, - "Hopper_frequency", - FrequencyList_get(app->subghz_hopper_freqs, i), - 1); + file, "Hopper_frequency", FrequencyList_get(app->subghz_hopper_freqs, i), 1); } } while(false); flipper_format_free(file); @@ -82,15 +79,14 @@ bool xtreme_app_apply(XtremeApp* app) { if(!flipper_format_write_header_cstr(file, NAMECHANGER_HEADER, 1)) break; if(!flipper_format_write_comment_cstr( - file, - "Changing the value below will change your FlipperZero device name.")) + file, "Changing the value below will change your FlipperZero device name.")) break; if(!flipper_format_write_comment_cstr( - file, - "Note: This is limited to 8 characters using the following: a-z, A-Z, 0-9, and _")) + file, + "Note: This is limited to 8 characters using the following: a-z, A-Z, 0-9, and _")) break; if(!flipper_format_write_comment_cstr( - file, "It cannot contain any other characters.")) + file, "It cannot contain any other characters.")) break; if(!flipper_format_write_string_cstr(file, "Name", app->device_name)) break; diff --git a/applications/services/desktop/views/desktop_view_slideshow.c b/applications/services/desktop/views/desktop_view_slideshow.c index bcb72df67..89dfad570 100644 --- a/applications/services/desktop/views/desktop_view_slideshow.c +++ b/applications/services/desktop/views/desktop_view_slideshow.c @@ -41,33 +41,33 @@ static bool desktop_view_slideshow_input(InputEvent* event, void* context) { if(event->type == InputTypeShort) { update_view = true; switch(model->slideshow->current_frame) { - case 0: - if(event->key == InputKeyRight) slideshow_advance(model->slideshow); - break; - case 1: - if(event->key == InputKeyUp) { - slideshow_advance(model->slideshow); - furi_timer_start(instance->auto_timer, 2 * furi_kernel_get_tick_frequency()); - } - break; - case 5: - furi_timer_stop(instance->auto_timer); - if(event->key == InputKeyRight) { - slideshow_advance(model->slideshow); - } else if(event->key == InputKeyLeft) { - model->slideshow->current_frame = 2; - furi_timer_start(instance->auto_timer, 2 * furi_kernel_get_tick_frequency()); - } - break; - case 6: - if(event->key == InputKeyOk) { - instance->callback(DesktopSlideshowCompleted, instance->context); - } else if(event->key == InputKeyLeft) { - model->slideshow->current_frame = 0; - } - break; - default: - break; + case 0: + if(event->key == InputKeyRight) slideshow_advance(model->slideshow); + break; + case 1: + if(event->key == InputKeyUp) { + slideshow_advance(model->slideshow); + furi_timer_start(instance->auto_timer, 2 * furi_kernel_get_tick_frequency()); + } + break; + case 5: + furi_timer_stop(instance->auto_timer); + if(event->key == InputKeyRight) { + slideshow_advance(model->slideshow); + } else if(event->key == InputKeyLeft) { + model->slideshow->current_frame = 2; + furi_timer_start(instance->auto_timer, 2 * furi_kernel_get_tick_frequency()); + } + break; + case 6: + if(event->key == InputKeyOk) { + instance->callback(DesktopSlideshowCompleted, instance->context); + } else if(event->key == InputKeyLeft) { + model->slideshow->current_frame = 0; + } + break; + default: + break; } } } else { diff --git a/scripts/update.py b/scripts/update.py index bf8c24e14..c90a853f5 100755 --- a/scripts/update.py +++ b/scripts/update.py @@ -129,7 +129,10 @@ class Main(App): SlideshowMain(no_exit=True)( [ "-i", - str(pathlib.Path(self.args.resources).parent / "slideshow/xfwfirstboot"), + str( + pathlib.Path(self.args.resources).parent + / "slideshow/xfwfirstboot" + ), "-o", str(pathlib.Path(self.args.resources) / "dolphin/xfwfirstboot.bin"), ]