Major patch to split haptic and audio queues into separate systems.
Patch is testing and working on the sky9xboard and the stock board. I dont have a gruvin board to test on. Currently only events that trigger haptic alerts are WARNING1-3 and TRIM MIDDLE. Next step is for bertrand to use the hooks to enable a per alert option to choose enable haptic. Also... translations are added but the menu file does not use the translation yet - as I have not got my head round how this works!
This commit is contained in:
+15
-1
@@ -64,6 +64,11 @@ uint16_t g_time_per10;
|
||||
audioQueue audio;
|
||||
#endif
|
||||
|
||||
#ifdef HAPTIC
|
||||
//new audio object
|
||||
hapticQueue haptic;
|
||||
#endif
|
||||
|
||||
uint8_t heartbeat;
|
||||
|
||||
uint8_t stickMode;
|
||||
@@ -875,6 +880,8 @@ uint8_t checkTrim(uint8_t event)
|
||||
beepTrim = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ((before<after && after>TRIM_MAX) || (before>after && after<TRIM_MIN)) {
|
||||
if (!g_model.extendedTrims) after = before;
|
||||
@@ -903,7 +910,8 @@ uint8_t checkTrim(uint8_t event)
|
||||
|
||||
if (beepTrim) {
|
||||
killEvents(event);
|
||||
AUDIO_WARNING2();
|
||||
//AUDIO_WARNING2();
|
||||
audio.event(AU_TRIM_MIDDLE);
|
||||
}
|
||||
else {
|
||||
#if defined (AUDIO)
|
||||
@@ -2037,8 +2045,11 @@ void perMain()
|
||||
|
||||
#if defined(PCBARM)
|
||||
AUDIO_HEARTBEAT(); // the queue processing
|
||||
HAPTIC_HEARTBEAT();
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
}
|
||||
int16_t g_ppmIns[8];
|
||||
uint8_t ppmInState = 0; //0=unsync 1..8= wait for value i-1
|
||||
@@ -2096,6 +2107,8 @@ ISR(TIMER0_COMP_vect, ISR_NOBLOCK) //10ms timer
|
||||
#endif
|
||||
|
||||
sei();
|
||||
|
||||
|
||||
|
||||
#if defined (PCBSTD) && defined (AUDIO)
|
||||
AUDIO_DRIVER();
|
||||
@@ -2106,6 +2119,7 @@ ISR(TIMER0_COMP_vect, ISR_NOBLOCK) //10ms timer
|
||||
#endif
|
||||
|
||||
AUDIO_HEARTBEAT();
|
||||
HAPTIC_HEARTBEAT();
|
||||
|
||||
#ifdef DEBUG
|
||||
// Record start time from TCNT1 to record excution time
|
||||
|
||||
Reference in New Issue
Block a user