esp_flasher_app_i.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //** Includes sniffbt and sniffskim for compatible ESP32-WROOM hardware.
  2. // esp_flasher_scene_start.c also changed **//
  3. #pragma once
  4. #include "esp_flasher_app.h"
  5. #include "scenes/esp_flasher_scene.h"
  6. #include "esp_flasher_custom_event.h"
  7. #include "esp_flasher_uart.h"
  8. #include "file/sequential_file.h"
  9. #include <gui/gui.h>
  10. #include <gui/view_dispatcher.h>
  11. #include <gui/scene_manager.h>
  12. #include <gui/modules/text_box.h>
  13. #include <gui/modules/submenu.h>
  14. #include <gui/modules/variable_item_list.h>
  15. #include <gui/modules/widget.h>
  16. #include <esp_flasher_icons.h>
  17. #include <storage/storage.h>
  18. #include <lib/toolbox/path.h>
  19. #include <dialogs/dialogs.h>
  20. #include <notification/notification_messages.h>
  21. #include <assets_icons.h>
  22. #define ESP_FLASHER_TEXT_BOX_STORE_SIZE (4096)
  23. #define ESP_APP_FOLDER_USER "apps_data/esp_flasher"
  24. #define ESP_APP_FOLDER EXT_PATH(ESP_APP_FOLDER_USER)
  25. typedef enum SelectedFlashOptions {
  26. SelectedFlashS3Mode,
  27. SelectedFlashBoot,
  28. SelectedFlashPart,
  29. SelectedFlashNvs,
  30. SelectedFlashBootApp0,
  31. SelectedFlashAppA,
  32. SelectedFlashAppB,
  33. SelectedFlashCustom,
  34. NUM_FLASH_OPTIONS
  35. } SelectedFlashOptions;
  36. typedef enum {
  37. SwitchNotSet,
  38. SwitchToFirmwareA,
  39. SwitchToFirmwareB,
  40. } SwitchFirmware;
  41. struct EspFlasherApp {
  42. Gui* gui;
  43. ViewDispatcher* view_dispatcher;
  44. SceneManager* scene_manager;
  45. FuriString* text_box_store;
  46. size_t text_box_store_strlen;
  47. TextBox* text_box;
  48. Storage* storage;
  49. DialogsApp* dialogs;
  50. NotificationApp* notification;
  51. VariableItemList* var_item_list;
  52. Widget* widget;
  53. Submenu* submenu;
  54. EspFlasherUart* uart;
  55. bool reset;
  56. bool boot;
  57. bool quickflash;
  58. SwitchFirmware switch_fw;
  59. bool selected_flash_options[NUM_FLASH_OPTIONS];
  60. int num_selected_flash_options;
  61. char bin_file_path_boot[100];
  62. char bin_file_path_part[100];
  63. char bin_file_path_nvs[100];
  64. char bin_file_path_boot_app0[100];
  65. char bin_file_path_app_a[100];
  66. char bin_file_path_app_b[100];
  67. char bin_file_path_custom[100];
  68. FuriThread* flash_worker;
  69. bool flash_worker_busy;
  70. };
  71. typedef enum {
  72. EspFlasherAppViewVarItemList,
  73. EspFlasherAppViewConsoleOutput,
  74. EspFlasherAppViewTextInput,
  75. EspFlasherAppViewWidget,
  76. EspFlasherAppViewSubmenu,
  77. } EspFlasherAppView;