esp_flasher_app_i.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 turbospeed;
  56. bool reset;
  57. bool boot;
  58. bool quickflash;
  59. SwitchFirmware switch_fw;
  60. bool selected_flash_options[NUM_FLASH_OPTIONS];
  61. int num_selected_flash_options;
  62. char bin_file_path_boot[100];
  63. char bin_file_path_part[100];
  64. char bin_file_path_nvs[100];
  65. char bin_file_path_boot_app0[100];
  66. char bin_file_path_app_a[100];
  67. char bin_file_path_app_b[100];
  68. char bin_file_path_custom[100];
  69. FuriThread* flash_worker;
  70. bool flash_worker_busy;
  71. };
  72. typedef enum {
  73. EspFlasherAppViewVarItemList,
  74. EspFlasherAppViewConsoleOutput,
  75. EspFlasherAppViewTextInput,
  76. EspFlasherAppViewWidget,
  77. EspFlasherAppViewSubmenu,
  78. } EspFlasherAppView;