avr_isp_scene_about.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #include "../avr_isp_app_i.h"
  2. #include "../helpers/avr_isp_types.h"
  3. void avr_isp_scene_about_widget_callback(GuiButtonType result, InputType type, void* context) {
  4. furi_assert(context);
  5. AvrIspApp* app = context;
  6. if(type == InputTypeShort) {
  7. view_dispatcher_send_custom_event(app->view_dispatcher, result);
  8. }
  9. }
  10. void avr_isp_scene_about_on_enter(void* context) {
  11. furi_assert(context);
  12. AvrIspApp* app = context;
  13. FuriString* temp_str = furi_string_alloc();
  14. furi_string_printf(temp_str, "\e#%s\n", "Information");
  15. furi_string_cat_printf(temp_str, "Version: %s\n", AVR_ISP_VERSION_APP);
  16. furi_string_cat_printf(temp_str, "Developed by: %s\n", AVR_ISP_DEVELOPED);
  17. furi_string_cat_printf(temp_str, "Github: %s\n\n", AVR_ISP_GITHUB);
  18. furi_string_cat_printf(temp_str, "\e#%s\n", "Description");
  19. furi_string_cat_printf(
  20. temp_str,
  21. "This application is an AVR in-system programmer based on stk500mk1. It is compatible with AVR-based"
  22. " microcontrollers including Arduino. You can also use it to repair the chip if you accidentally"
  23. " corrupt the bootloader.\n\n");
  24. furi_string_cat_printf(temp_str, "\e#%s\n", "What it can do:");
  25. furi_string_cat_printf(temp_str, "- Create a dump of your chip on an SD card\n");
  26. furi_string_cat_printf(temp_str, "- Flash your chip firmware from the SD card\n");
  27. furi_string_cat_printf(temp_str, "- Act as a wired USB ISP using avrdude software\n\n");
  28. furi_string_cat_printf(temp_str, "\e#%s\n", "Supported chip series:");
  29. furi_string_cat_printf(
  30. temp_str,
  31. "Example command for avrdude flashing: avrdude.exe -p m328p -c stk500v1 -P COMxx -U flash:r:"
  32. "X:\\sketch_sample.hex"
  33. ":i\n");
  34. furi_string_cat_printf(
  35. temp_str,
  36. "Where: "
  37. "-p m328p"
  38. " brand of your chip, "
  39. "-P COMxx"
  40. " com port number in the system when "
  41. "ISP Programmer"
  42. " is enabled\n\n");
  43. furi_string_cat_printf(temp_str, "\e#%s\n", "Info");
  44. furi_string_cat_printf(
  45. temp_str,
  46. "ATtinyXXXX\nATmegaXXXX\nAT43Uxxx\nAT76C711\nAT86RF401\nAT90xxxxx\nAT94K\n"
  47. "ATAxxxxx\nATA664251\nM3000\nLGT8F88P\nLGT8F168P\nLGT8F328P\n");
  48. furi_string_cat_printf(
  49. temp_str, "For a more detailed list of supported chips, see AVRDude help\n");
  50. widget_add_text_box_element(
  51. app->widget,
  52. 0,
  53. 0,
  54. 128,
  55. 14,
  56. AlignCenter,
  57. AlignBottom,
  58. "\e#\e! \e!\n",
  59. false);
  60. widget_add_text_box_element(
  61. app->widget,
  62. 0,
  63. 2,
  64. 128,
  65. 14,
  66. AlignCenter,
  67. AlignBottom,
  68. "\e#\e! ISP Programmer \e!\n",
  69. false);
  70. widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str));
  71. furi_string_free(temp_str);
  72. view_dispatcher_switch_to_view(app->view_dispatcher, AvrIspViewWidget);
  73. }
  74. bool avr_isp_scene_about_on_event(void* context, SceneManagerEvent event) {
  75. UNUSED(context);
  76. UNUSED(event);
  77. return false;
  78. }
  79. void avr_isp_scene_about_on_exit(void* context) {
  80. furi_assert(context);
  81. AvrIspApp* app = context;
  82. // Clear views
  83. widget_reset(app->widget);
  84. }