meal_pager_haptic.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. #include "meal_pager_haptic.h"
  2. void meal_pager_play_happy_bump(void* context) {
  3. Meal_Pager* app = context;
  4. if(app->haptic != 1) {
  5. return;
  6. }
  7. notification_message(app->notification, &sequence_set_vibro_on);
  8. furi_thread_flags_wait(0, FuriFlagWaitAny, 20);
  9. notification_message(app->notification, &sequence_reset_vibro);
  10. }
  11. void meal_pager_play_bad_bump(void* context) {
  12. Meal_Pager* app = context;
  13. if(app->haptic != 1) {
  14. return;
  15. }
  16. notification_message(app->notification, &sequence_set_vibro_on);
  17. furi_thread_flags_wait(0, FuriFlagWaitAny, 100);
  18. notification_message(app->notification, &sequence_reset_vibro);
  19. }
  20. void meal_pager_play_long_bump(void* context) {
  21. Meal_Pager* app = context;
  22. if(app->haptic != 1) {
  23. return;
  24. }
  25. for(int i = 0; i < 4; i++) {
  26. notification_message(app->notification, &sequence_set_vibro_on);
  27. furi_thread_flags_wait(0, FuriFlagWaitAny, 50);
  28. notification_message(app->notification, &sequence_reset_vibro);
  29. furi_thread_flags_wait(0, FuriFlagWaitAny, 100);
  30. }
  31. }