gpio_scene_test.c 1.0 KB

1234567891011121314151617181920212223242526272829303132
  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. furi_assert(context);
  13. GpioApp* app = context;
  14. gpio_items_configure_all_pins(app->gpio_items, GpioModeOutputPushPull);
  15. gpio_test_set_ok_callback(app->gpio_test, gpio_scene_test_ok_callback, app);
  16. view_dispatcher_switch_to_view(app->view_dispatcher, GpioAppViewGpioTest);
  17. }
  18. bool gpio_scene_test_on_event(void* context, SceneManagerEvent event) {
  19. UNUSED(context);
  20. UNUSED(event);
  21. return false;
  22. }
  23. void gpio_scene_test_on_exit(void* context) {
  24. furi_assert(context);
  25. GpioApp* app = context;
  26. gpio_items_configure_all_pins(app->gpio_items, GpioModeAnalog);
  27. }