feat(cpn): visual and audible feedback for haptic in simulator (#7322)

This commit is contained in:
Kudzz
2026-07-20 19:09:43 +10:00
committed by GitHub
parent 8aa6ff723e
commit 14e6d6ce01
9 changed files with 89 additions and 4 deletions
+9
View File
@@ -22,6 +22,11 @@
#include "edgetx.h"
#include "haptic.h"
#if defined(SIMU)
#include <stdint.h>
extern uint32_t simuHapticValue;
#endif
hapticQueue::hapticQueue()
{
buzzTimeLeft = 0;
@@ -96,6 +101,10 @@ void hapticQueue::play(uint8_t tLen, uint8_t tPause, uint8_t tFlags)
void hapticQueue::event(uint8_t e)
{
if (g_eeGeneral.hapticMode >= e_mode_nokeys || (g_eeGeneral.hapticMode >= e_mode_alarms && e <= AU_ERROR)) {
#if defined(SIMU)
simuHapticValue++;
return;
#endif
if (e <= AU_ERROR)
play(15, 3, PLAY_NOW);
else if (e <= AU_MIX_WARNING_3)