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:
rob@marotori.com
2012-04-13 12:22:04 +00:00
parent f59d7a3836
commit f7b1754257
12 changed files with 106 additions and 183 deletions
+3 -21
View File
@@ -34,12 +34,6 @@
#ifndef audio_h
#define audio_h
//#define ISER9X //enable this define for er9x. comment out for open9x
#if defined(ISER9X)
#define HAPTIC
#define PCBSTD
#endif
#if defined(PCBARM)
#include "ersky9x/sound.h"
@@ -93,11 +87,6 @@ enum AUDIO_SOUNDS {
AU_FRSKY_ALARMC,
AU_FRSKY_RATATA,
AU_FRSKY_TICK,
#ifdef HAPTIC
AU_FRSKY_HAPTIC1,
AU_FRSKY_HAPTIC2,
AU_FRSKY_HAPTIC3,
#endif
AU_FRSKY_LAST,
};
@@ -109,9 +98,9 @@ class audioQueue
// only difference between these two functions is that one does the
// interupt queue (Now) and the other queues for playing ASAP.
void playNow(uint8_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tRepeat=0, uint8_t tHaptic=0, int8_t tFreqIncr=0);
void playNow(uint8_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tRepeat=0, int8_t tFreqIncr=0);
void playASAP(uint8_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tRepeat=0, uint8_t tHaptic=0, int8_t tFreqIncr=0);
void playASAP(uint8_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tRepeat=0, int8_t tFreqIncr=0);
inline bool busy() { return (toneTimeLeft > 0); }
@@ -184,12 +173,7 @@ class audioQueue
uint8_t queueTonePause[AUDIO_QUEUE_LENGTH];
uint8_t queueToneRepeat[AUDIO_QUEUE_LENGTH];
#ifdef HAPTIC
uint8_t toneHaptic;
uint8_t hapticTick;
uint8_t queueToneHaptic[AUDIO_QUEUE_LENGTH];
uint8_t hapticSpinUpTime;
#endif
#if defined(PCBSTD)
uint8_t toneCounter;
@@ -201,8 +185,6 @@ extern audioQueue audio;
void audioDefevent(uint8_t e);
#define HAPTIC_SPINUP (10);
#define AUDIO_KEYPAD_UP() audioDefevent(AU_KEYPAD_UP)
#define AUDIO_KEYPAD_DOWN() audioDefevent(AU_KEYPAD_DOWN)
#define AUDIO_MENUS() audioDefevent(AU_MENUS)