esp_flasher_app_i.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. SelectedFlashApp,
  31. SelectedFlashCustom,
  32. NUM_FLASH_OPTIONS
  33. } SelectedFlashOptions;
  34. struct EspFlasherApp {
  35. Gui* gui;
  36. ViewDispatcher* view_dispatcher;
  37. SceneManager* scene_manager;
  38. FuriString* text_box_store;
  39. size_t text_box_store_strlen;
  40. TextBox* text_box;
  41. Storage* storage;
  42. DialogsApp* dialogs;
  43. NotificationApp* notification;
  44. VariableItemList* var_item_list;
  45. Widget* widget;
  46. Submenu* submenu;
  47. EspFlasherUart* uart;
  48. bool reset;
  49. bool boot;
  50. bool selected_flash_options[NUM_FLASH_OPTIONS];
  51. int num_selected_flash_options;
  52. char bin_file_path_boot[100];
  53. char bin_file_path_part[100];
  54. char bin_file_path_nvs[100];
  55. char bin_file_path_boot_app0[100];
  56. char bin_file_path_app[100];
  57. char bin_file_path_custom[100];
  58. FuriThread* flash_worker;
  59. bool flash_worker_busy;
  60. };
  61. typedef enum {
  62. EspFlasherAppViewVarItemList,
  63. EspFlasherAppViewConsoleOutput,
  64. EspFlasherAppViewTextInput,
  65. EspFlasherAppViewWidget,
  66. EspFlasherAppViewSubmenu,
  67. } EspFlasherAppView;