scope_scene_about.c 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #include "../scope_app_i.h"
  2. void scope_scene_about_widget_callback(GuiButtonType result, InputType type, void* context) {
  3. ScopeApp* app = context;
  4. if(type == InputTypeShort) {
  5. view_dispatcher_send_custom_event(app->view_dispatcher, result);
  6. }
  7. }
  8. void scope_scene_about_on_enter(void* context) {
  9. ScopeApp* app = context;
  10. FuriString* temp_str;
  11. temp_str = furi_string_alloc();
  12. furi_string_printf(temp_str, "\e#%s\n", "Information");
  13. furi_string_cat_printf(temp_str, "Version: %s\n\n", FAP_VERSION);
  14. furi_string_cat_printf(
  15. temp_str,
  16. "Provide signal to pin 16/PC0, with a voltage ranging from 0V to 2.5V and ground to pin 18/GND.\n\n");
  17. furi_string_cat_printf(temp_str, "Developed by: %s\n", S_DEVELOPED);
  18. furi_string_cat_printf(temp_str, "Github: %s\n\n", S_GITHUB);
  19. widget_add_text_box_element(
  20. app->widget,
  21. 0,
  22. 0,
  23. 128,
  24. 14,
  25. AlignCenter,
  26. AlignBottom,
  27. "\e#\e! \e!\n",
  28. false);
  29. widget_add_text_box_element(
  30. app->widget,
  31. 0,
  32. 2,
  33. 128,
  34. 14,
  35. AlignCenter,
  36. AlignBottom,
  37. "\e#\e! flipperscope \e!\n",
  38. false);
  39. widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str));
  40. furi_string_free(temp_str);
  41. view_dispatcher_switch_to_view(app->view_dispatcher, ScopeViewWidget);
  42. }
  43. bool scope_scene_about_on_event(void* context, SceneManagerEvent event) {
  44. ScopeApp* app = context;
  45. bool consumed = false;
  46. UNUSED(app);
  47. UNUSED(event);
  48. return consumed;
  49. }
  50. void scope_scene_about_on_exit(void* context) {
  51. ScopeApp* app = context;
  52. // Clear views
  53. widget_reset(app->widget);
  54. }