scope_scene_about.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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(
  14. temp_str,
  15. "Provide signal to pin 16/PC0, with a voltage ranging from 0V to 2.5V and ground to pin 18/GND.\n\n");
  16. furi_string_cat_printf(temp_str, "Developed by: %s\n", S_DEVELOPED);
  17. furi_string_cat_printf(temp_str, "Github: %s\n\n", S_GITHUB);
  18. widget_add_text_box_element(
  19. app->widget,
  20. 0,
  21. 0,
  22. 128,
  23. 14,
  24. AlignCenter,
  25. AlignBottom,
  26. "\e#\e! \e!\n",
  27. false);
  28. widget_add_text_box_element(
  29. app->widget,
  30. 0,
  31. 2,
  32. 128,
  33. 14,
  34. AlignCenter,
  35. AlignBottom,
  36. "\e#\e! flipperscope \e!\n",
  37. false);
  38. widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str));
  39. furi_string_free(temp_str);
  40. view_dispatcher_switch_to_view(app->view_dispatcher, ScopeViewWidget);
  41. }
  42. bool scope_scene_about_on_event(void* context, SceneManagerEvent event) {
  43. ScopeApp* app = context;
  44. bool consumed = false;
  45. UNUSED(app);
  46. UNUSED(event);
  47. return consumed;
  48. }
  49. void scope_scene_about_on_exit(void* context) {
  50. ScopeApp* app = context;
  51. // Clear views
  52. widget_reset(app->widget);
  53. }