esp_flasher_app_i.h 1.9 KB

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