gpio_scene_test.c 929 B

123456789101112131415161718192021222324252627282930
  1. #include "../gpio_app_i.h"
  2. void gpio_scene_test_ok_callback(InputType type, void* context) {
  3. furi_assert(context);
  4. GpioApp* app = context;
  5. if(type == InputTypePress) {
  6. notification_message(app->notifications, &sequence_set_green_255);
  7. } else if(type == InputTypeRelease) {
  8. notification_message(app->notifications, &sequence_reset_green);
  9. }
  10. }
  11. void gpio_scene_test_on_enter(void* context) {
  12. GpioApp* app = context;
  13. gpio_item_configure_all_pins(GpioModeOutputPushPull);
  14. gpio_test_set_ok_callback(app->gpio_test, gpio_scene_test_ok_callback, app);
  15. view_dispatcher_switch_to_view(app->view_dispatcher, GpioAppViewGpioTest);
  16. }
  17. bool gpio_scene_test_on_event(void* context, SceneManagerEvent event) {
  18. UNUSED(context);
  19. UNUSED(event);
  20. return false;
  21. }
  22. void gpio_scene_test_on_exit(void* context) {
  23. UNUSED(context);
  24. gpio_item_configure_all_pins(GpioModeAnalog);
  25. }