diff --git a/non_catalog_apps/esp_flasher/packedfws/blackmagic/blackmagic.bin b/non_catalog_apps/esp_flasher/packedfws/blackmagic/s2/blackmagic.bin similarity index 100% rename from non_catalog_apps/esp_flasher/packedfws/blackmagic/blackmagic.bin rename to non_catalog_apps/esp_flasher/packedfws/blackmagic/s2/blackmagic.bin diff --git a/non_catalog_apps/esp_flasher/packedfws/blackmagic/bootloader.bin b/non_catalog_apps/esp_flasher/packedfws/blackmagic/s2/bootloader.bin similarity index 100% rename from non_catalog_apps/esp_flasher/packedfws/blackmagic/bootloader.bin rename to non_catalog_apps/esp_flasher/packedfws/blackmagic/s2/bootloader.bin diff --git a/non_catalog_apps/esp_flasher/packedfws/blackmagic/partition-table.bin b/non_catalog_apps/esp_flasher/packedfws/blackmagic/s2/partition-table.bin similarity index 100% rename from non_catalog_apps/esp_flasher/packedfws/blackmagic/partition-table.bin rename to non_catalog_apps/esp_flasher/packedfws/blackmagic/s2/partition-table.bin diff --git a/non_catalog_apps/esp_flasher/packedfws/marauder/S2/esp32_marauder.flipper.bin b/non_catalog_apps/esp_flasher/packedfws/marauder/S2/esp32_marauder.flipper.bin index 50b8a706088..5e689fd0ab4 100644 Binary files a/non_catalog_apps/esp_flasher/packedfws/marauder/S2/esp32_marauder.flipper.bin and b/non_catalog_apps/esp_flasher/packedfws/marauder/S2/esp32_marauder.flipper.bin differ diff --git a/non_catalog_apps/esp_flasher/packedfws/marauder/WROOM/esp32_marauder.dev_board_pro.bin b/non_catalog_apps/esp_flasher/packedfws/marauder/WROOM/esp32_marauder.dev_board_pro.bin index d25db4c0270..be60f6f88fc 100644 Binary files a/non_catalog_apps/esp_flasher/packedfws/marauder/WROOM/esp32_marauder.dev_board_pro.bin and b/non_catalog_apps/esp_flasher/packedfws/marauder/WROOM/esp32_marauder.dev_board_pro.bin differ diff --git a/non_catalog_apps/esp_flasher/packedfws/marauder/s3/esp32_marauder.ino.bootloader.bin b/non_catalog_apps/esp_flasher/packedfws/marauder/s3/esp32_marauder.ino.bootloader.bin new file mode 100644 index 00000000000..d13c1ecaf4a Binary files /dev/null and b/non_catalog_apps/esp_flasher/packedfws/marauder/s3/esp32_marauder.ino.bootloader.bin differ diff --git a/non_catalog_apps/esp_flasher/packedfws/marauder/s3/esp32_marauder.multiboardS3.bin b/non_catalog_apps/esp_flasher/packedfws/marauder/s3/esp32_marauder.multiboardS3.bin new file mode 100644 index 00000000000..1eebe108980 Binary files /dev/null and b/non_catalog_apps/esp_flasher/packedfws/marauder/s3/esp32_marauder.multiboardS3.bin differ diff --git a/non_catalog_apps/esp_flasher/scenes/esp_flasher_scene_quick.c b/non_catalog_apps/esp_flasher/scenes/esp_flasher_scene_quick.c index 67ff48e71fc..3550464fea1 100644 --- a/non_catalog_apps/esp_flasher/scenes/esp_flasher_scene_quick.c +++ b/non_catalog_apps/esp_flasher/scenes/esp_flasher_scene_quick.c @@ -1,17 +1,28 @@ #include "../esp_flasher_app_i.h" +// DO NOT use as an example, you should split into different scene files for each screen +// To keep in a single file, this is setup in an unusual and confusing way +// You can find more info in comments throughout + +// There's one entry for each item on quick flash menu +// Following each one, there are its submenu items +// Not all boards support automatic bootmode, so here we separate into those that do and don't enum QuickState { QuickStart, - QuickBootS2, - QuickBootS2_Marauder, - QuickBootS2_Blackmagic, - QuickBootWROOM, - QuickBootWROOM_Marauder, + QuickS2Boot, + QuickS2Boot_Marauder, + QuickS2Boot_Blackmagic, + QuickWROOMBoot, + QuickWROOMBoot_Marauder, + QuickS3Boot, + QuickS3Boot_Marauder, QuickWROOM, QuickWROOM_Marauder, QuickS2, QuickS2_Marauder, QuickS2_Blackmagic, + QuickS3, + QuickS3_Marauder, }; void esp_flasher_scene_quick_submenu_callback(void* context, uint32_t index) { @@ -27,21 +38,36 @@ void esp_flasher_scene_quick_on_enter(void* context) { Submenu* submenu = app->submenu; uint32_t state = scene_manager_get_scene_state(app->scene_manager, EspFlasherSceneQuick); + // State indicates the currently selected (or activated) item + // So map quick flash menu values to show the quick flash menu + // And map submenu values to show corresponding submenu switch(state) { case QuickStart: - case QuickBootS2: - case QuickBootWROOM: + case QuickS2Boot: + case QuickWROOMBoot: + case QuickS3Boot: case QuickWROOM: case QuickS2: + case QuickS3: submenu_set_header(submenu, "Choose Board:"); submenu_add_item( submenu, - "Flipper WiFi Board / Xeon", - QuickBootS2, + "Flipper WiFi Devboard", + QuickS2Boot, esp_flasher_scene_quick_submenu_callback, app); submenu_add_item( - submenu, "Multi-Fucc", QuickBootWROOM, esp_flasher_scene_quick_submenu_callback, app); + submenu, + "ESP32-WROOM (bootloader)", + QuickWROOMBoot, + esp_flasher_scene_quick_submenu_callback, + app); + submenu_add_item( + submenu, + "ESP32-S3 (bootloader)", + QuickS3Boot, + esp_flasher_scene_quick_submenu_callback, + app); submenu_add_item( submenu, "Other ESP32-WROOM", @@ -50,32 +76,44 @@ void esp_flasher_scene_quick_on_enter(void* context) { app); submenu_add_item( submenu, "Other ESP32-S2", QuickS2, esp_flasher_scene_quick_submenu_callback, app); + submenu_add_item( + submenu, "Other ESP32-S3", QuickS3, esp_flasher_scene_quick_submenu_callback, app); break; - case QuickBootS2_Marauder: - case QuickBootS2_Blackmagic: + case QuickS2Boot_Marauder: + case QuickS2Boot_Blackmagic: case QuickS2_Marauder: case QuickS2_Blackmagic: submenu_set_header(submenu, "Choose Firmware:"); submenu_add_item( submenu, "Marauder (has Evil Portal)", - state > QuickS2 ? QuickS2_Marauder : QuickBootS2_Marauder, + state > QuickS2 ? QuickS2_Marauder : QuickS2Boot_Marauder, esp_flasher_scene_quick_submenu_callback, app); submenu_add_item( submenu, "Black Magic", - state > QuickS2 ? QuickS2_Blackmagic : QuickBootS2_Blackmagic, + state > QuickS2 ? QuickS2_Blackmagic : QuickS2Boot_Blackmagic, esp_flasher_scene_quick_submenu_callback, app); break; - case QuickBootWROOM_Marauder: + case QuickWROOMBoot_Marauder: case QuickWROOM_Marauder: submenu_set_header(submenu, "Choose Firmware:"); submenu_add_item( submenu, "Marauder (has Evil Portal)", - state > QuickWROOM ? QuickWROOM_Marauder : QuickBootWROOM_Marauder, + state > QuickWROOM ? QuickWROOM_Marauder : QuickWROOMBoot_Marauder, + esp_flasher_scene_quick_submenu_callback, + app); + break; + case QuickS3Boot_Marauder: + case QuickS3_Marauder: + submenu_set_header(submenu, "Choose Firmware:"); + submenu_add_item( + submenu, + "Marauder (has Evil Portal)", + state > QuickS3 ? QuickS3_Marauder : QuickS3Boot_Marauder, esp_flasher_scene_quick_submenu_callback, app); break; @@ -97,49 +135,63 @@ bool esp_flasher_scene_quick_on_event(void* context, SceneManagerEvent event) { consumed = true; bool enter_bootloader = false; - const char* boot = NULL; // 0x1000 + bool s3 = false; + const char* boot = NULL; // 0x1000 (or 0x0 on S3) const char* part = NULL; // 0x8000 const char* app0 = NULL; // 0xE000 const char* firm = NULL; // 0x10000 switch(event.event) { - case QuickBootS2: - case QuickBootWROOM: + case QuickS2Boot: + case QuickWROOMBoot: + case QuickS3Boot: case QuickWROOM: case QuickS2: + case QuickS3: + // Select first item of submenu scene_manager_set_scene_state( app->scene_manager, EspFlasherSceneQuick, event.event + 1); scene_manager_next_scene(app->scene_manager, EspFlasherSceneQuick); return consumed; - case QuickBootS2_Marauder: + case QuickS2Boot_Marauder: enter_bootloader = true; /* fallthrough */ case QuickS2_Marauder: - boot = APP_ASSETS_PATH("marauder/S2/esp32_marauder.ino.bootloader.bin"); + boot = APP_ASSETS_PATH("marauder/s2/esp32_marauder.ino.bootloader.bin"); part = APP_ASSETS_PATH("marauder/esp32_marauder.ino.partitions.bin"); app0 = APP_ASSETS_PATH("marauder/boot_app0.bin"); - firm = APP_ASSETS_PATH("marauder/S2/esp32_marauder.flipper.bin"); + firm = APP_ASSETS_PATH("marauder/s2/esp32_marauder.flipper.bin"); break; - case QuickBootS2_Blackmagic: + case QuickS2Boot_Blackmagic: enter_bootloader = true; /* fallthrough */ case QuickS2_Blackmagic: - boot = APP_ASSETS_PATH("blackmagic/bootloader.bin"); - part = APP_ASSETS_PATH("blackmagic/partition-table.bin"); - firm = APP_ASSETS_PATH("blackmagic/blackmagic.bin"); + boot = APP_ASSETS_PATH("blackmagic/s2/bootloader.bin"); + part = APP_ASSETS_PATH("blackmagic/s2/partition-table.bin"); + firm = APP_ASSETS_PATH("blackmagic/s2/blackmagic.bin"); break; - case QuickBootWROOM_Marauder: + case QuickWROOMBoot_Marauder: enter_bootloader = true; /* fallthrough */ case QuickWROOM_Marauder: - boot = APP_ASSETS_PATH("marauder/WROOM/esp32_marauder.ino.bootloader.bin"); + boot = APP_ASSETS_PATH("marauder/wroom/esp32_marauder.ino.bootloader.bin"); + part = APP_ASSETS_PATH("marauder/esp32_marauder.ino.partitions.bin"); + app0 = APP_ASSETS_PATH("marauder/boot_app0.bin"); + firm = APP_ASSETS_PATH("marauder/wroom/esp32_marauder.dev_board_pro.bin"); + break; + + case QuickS3Boot_Marauder: + enter_bootloader = true; + /* fallthrough */ + case QuickS3_Marauder: + s3 = true; + boot = APP_ASSETS_PATH("marauder/s3/esp32_marauder.ino.bootloader.bin"); part = APP_ASSETS_PATH("marauder/esp32_marauder.ino.partitions.bin"); app0 = APP_ASSETS_PATH("marauder/boot_app0.bin"); - firm = - APP_ASSETS_PATH("marauder/WROOM/esp32_marauder.dev_board_pro.bin"); + firm = APP_ASSETS_PATH("marauder/s3/esp32_marauder.multiboardS3.bin"); break; default: @@ -157,6 +209,7 @@ bool esp_flasher_scene_quick_on_event(void* context, SceneManagerEvent event) { app->bin_file_path_app_b[0] = '\0'; app->bin_file_path_custom[0] = '\0'; + app->selected_flash_options[SelectedFlashS3Mode] = s3; if(boot) { app->selected_flash_options[SelectedFlashBoot] = true; strncpy(app->bin_file_path_boot, boot, sizeof(app->bin_file_path_boot)); @@ -181,14 +234,20 @@ bool esp_flasher_scene_quick_on_event(void* context, SceneManagerEvent event) { scene_manager_next_scene(app->scene_manager, EspFlasherSceneConsoleOutput); } else if(event.type == SceneManagerEventTypeBack) { uint32_t state = scene_manager_get_scene_state(app->scene_manager, EspFlasherSceneQuick); - if(state > QuickS2) + // Pressing back from submenu, check if in submenu, select corresponding item in quick flash menu + if(state > QuickS3) + state = QuickS3; + else if(state > QuickS2) state = QuickS2; else if(state > QuickWROOM) state = QuickWROOM; - else if(state > QuickBootWROOM) - state = QuickBootWROOM; - else if(state > QuickBootS2) - state = QuickBootS2; + else if(state > QuickS3Boot) + state = QuickS3Boot; + else if(state > QuickWROOMBoot) + state = QuickWROOMBoot; + else if(state > QuickS2Boot) + state = QuickS2Boot; + // If pressing back from quick flash menu (not submenu), state will not matter scene_manager_set_scene_state(app->scene_manager, EspFlasherSceneQuick, state); }