mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 15:38:35 -07:00
feat: Chess v1.8
This commit is contained in:
35
applications/external/chess/helpers/flipchess_haptic.c
vendored
Normal file
35
applications/external/chess/helpers/flipchess_haptic.c
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
#include "flipchess_haptic.h"
|
||||
#include "../flipchess.h"
|
||||
|
||||
void flipchess_play_happy_bump(void* context) {
|
||||
FlipChess* app = context;
|
||||
if(app->haptic != 1) {
|
||||
return;
|
||||
}
|
||||
notification_message(app->notification, &sequence_set_vibro_on);
|
||||
furi_thread_flags_wait(0, FuriFlagWaitAny, 20);
|
||||
notification_message(app->notification, &sequence_reset_vibro);
|
||||
}
|
||||
|
||||
void flipchess_play_bad_bump(void* context) {
|
||||
FlipChess* app = context;
|
||||
if(app->haptic != 1) {
|
||||
return;
|
||||
}
|
||||
notification_message(app->notification, &sequence_set_vibro_on);
|
||||
furi_thread_flags_wait(0, FuriFlagWaitAny, 100);
|
||||
notification_message(app->notification, &sequence_reset_vibro);
|
||||
}
|
||||
|
||||
void flipchess_play_long_bump(void* context) {
|
||||
FlipChess* app = context;
|
||||
if(app->haptic != 1) {
|
||||
return;
|
||||
}
|
||||
for(int i = 0; i < 4; i++) {
|
||||
notification_message(app->notification, &sequence_set_vibro_on);
|
||||
furi_thread_flags_wait(0, FuriFlagWaitAny, 50);
|
||||
notification_message(app->notification, &sequence_reset_vibro);
|
||||
furi_thread_flags_wait(0, FuriFlagWaitAny, 100);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user