feat: add vibration feedback support for UI events

- Add genericVibration class with 5-second cooldown and 1-second pulse
- Integrate vibration triggers for new messages and contact discoveries
- Add conditional compilation support with PIN_VIBRATION guard
- Implement abstract interface for vibration in UITask system
This commit is contained in:
csrutil
2025-09-07 15:16:15 +08:00
parent d86851b881
commit 2da50882c0
6 changed files with 112 additions and 0 deletions

View File

@@ -11,6 +11,9 @@
#ifdef PIN_BUZZER
#include <helpers/ui/buzzer.h>
#endif
#ifdef PIN_VIBRATION
#include <helpers/ui/vibration.h>
#endif
#include "../AbstractUITask.h"
#include "../NodePrefs.h"
@@ -20,6 +23,9 @@ class UITask : public AbstractUITask {
SensorManager* _sensors;
#ifdef PIN_BUZZER
genericBuzzer buzzer;
#endif
#ifdef PIN_VIBRATION
genericVibration vibration;
#endif
unsigned long _next_refresh, _auto_off;
NodePrefs* _node_prefs;
@@ -72,6 +78,9 @@ public:
void msgRead(int msgcount) override;
void newMsg(uint8_t path_len, const char* from_name, const char* text, int msgcount) override;
void soundBuzzer(UIEventType bet = UIEventType::none) override;
#ifdef PIN_VIBRATION
void triggerVibration() override;
#endif
void loop() override;
void shutdown(bool restart = false);