mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2025-10-10 23:22:35 +02:00
Format
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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 {
|
||||
|
@@ -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"),
|
||||
]
|
||||
|
Reference in New Issue
Block a user