esp_flasher_app_i.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. #define ESP_FLASHER_TEXT_BOX_STORE_SIZE (4096)
  22. #define ESP_APP_FOLDER_USER "apps_data/esp_flasher"
  23. #define ESP_APP_FOLDER EXT_PATH(ESP_APP_FOLDER_USER)
  24. typedef enum SelectedFlashOptions {
  25. SelectedFlashS3Mode,
  26. SelectedFlashBoot,
  27. SelectedFlashPart,
  28. SelectedFlashNvs,
  29. SelectedFlashBootApp0,
  30. SelectedFlashAppA,
  31. SelectedFlashAppB,
  32. SelectedFlashCustom,
  33. NUM_FLASH_OPTIONS
  34. } SelectedFlashOptions;
  35. typedef enum {
  36. SwitchNotSet,
  37. SwitchToFirmwareA,
  38. SwitchToFirmwareB,
  39. } SwitchFirmware;
  40. struct EspFlasherApp {
  41. Gui* gui;
  42. ViewDispatcher* view_dispatcher;
  43. SceneManager* scene_manager;
  44. FuriString* text_box_store;
  45. size_t text_box_store_strlen;
  46. TextBox* text_box;
  47. Storage* storage;
  48. DialogsApp* dialogs;
  49. NotificationApp* notification;
  50. VariableItemList* var_item_list;
  51. Widget* widget;
  52. Submenu* submenu;
  53. EspFlasherUart* uart;
  54. bool reset;
  55. bool boot;
  56. SwitchFirmware switch_fw;
  57. bool selected_flash_options[NUM_FLASH_OPTIONS];
  58. int num_selected_flash_options;
  59. char bin_file_path_boot[100];
  60. char bin_file_path_part[100];
  61. char bin_file_path_nvs[100];
  62. char bin_file_path_boot_app0[100];
  63. char bin_file_path_app_a[100];
  64. char bin_file_path_app_b[100];
  65. char bin_file_path_custom[100];
  66. FuriThread* flash_worker;
  67. bool flash_worker_busy;
  68. };
  69. typedef enum {
  70. EspFlasherAppViewVarItemList,
  71. EspFlasherAppViewConsoleOutput,
  72. EspFlasherAppViewTextInput,
  73. EspFlasherAppViewWidget,
  74. EspFlasherAppViewSubmenu,
  75. } EspFlasherAppView;