esp_flasher_scene_about.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "../esp_flasher_app_i.h"
  2. void esp_flasher_scene_about_widget_callback(
  3. GuiButtonType result,
  4. InputType type,
  5. void* context) {
  6. EspFlasherApp* app = context;
  7. if(type == InputTypeShort) {
  8. view_dispatcher_send_custom_event(app->view_dispatcher, result);
  9. }
  10. }
  11. #define ESP_FLASHER_APP_DESCRIPTION "\e#Information\nVersion: " ESP_FLASHER_APP_VERSION "\nDeveloped by: 0xchocolate\n(@cococode on discord) using espressif's esp-serial-flasher library\nGithub: TODO\n\n\e#Description\nApp to flash ESP chips from\nthe flipper (over UART) using\nbin files on the sd card.\nReset the chip into bootloader\nmode before flashing.\n\n Supported targets:\n- ESP32\n- ESP8266\n- ESP32-S2\n- ESP32-S3\n- ESP32-C3\n- ESP32-C2\n- ESP32-H2"
  12. void esp_flasher_scene_about_on_enter(void* context) {
  13. EspFlasherApp* app = context;
  14. widget_add_text_box_element(
  15. app->widget,
  16. 0,
  17. 0,
  18. 128,
  19. 14,
  20. AlignCenter,
  21. AlignBottom,
  22. "\e#\e! \e!\n",
  23. false);
  24. widget_add_text_box_element(
  25. app->widget,
  26. 0,
  27. 2,
  28. 128,
  29. 14,
  30. AlignCenter,
  31. AlignBottom,
  32. "\e#\e! ESP Flasher \e!\n",
  33. false);
  34. widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, ESP_FLASHER_APP_DESCRIPTION);
  35. view_dispatcher_switch_to_view(app->view_dispatcher, EspFlasherAppViewWidget);
  36. }
  37. bool esp_flasher_scene_about_on_event(void* context, SceneManagerEvent event) {
  38. EspFlasherApp* app = context;
  39. bool consumed = false;
  40. UNUSED(app);
  41. UNUSED(event);
  42. return consumed;
  43. }
  44. void esp_flasher_scene_about_on_exit(void* context) {
  45. EspFlasherApp* app = context;
  46. // Clear views
  47. widget_reset(app->widget);
  48. }