HAPTIC is now able to work without AUDIO

New function in function switches to play an Audio track
Trims can be used to modify a mixer offset.
Offsets for Frsky can go from -128 to +127
Vibrations motor on v4 (HAPTIC option too)
This commit is contained in:
bsongis
2012-02-01 18:55:08 +00:00
parent 715c5967c7
commit 3e009decfb
13 changed files with 296 additions and 224 deletions
+2 -11
View File
@@ -14,13 +14,6 @@
#include "open9x.h"
#if defined(PCBV4)
#define SPEAKER_OFF TCCR0A &= ~(1<<COM0A0) // tone off
#define SPEAKER_ON TCCR0A |= (1<<COM0A0) // tone on
#else
#define SPEAKER_OFF PORTE &= ~(1 << OUT_E_BUZZER) // speaker output 'low'
#endif
audioQueue::audioQueue()
{
aqinit();
@@ -93,7 +86,6 @@ void audioQueue::heartbeat()
tonePause = queueTonePause[t_queueRidx];
#if defined(HAPTIC)
toneHaptic = queueToneHaptic[t_queueRidx];
hapticTick = 0;
#endif
if (!queueToneRepeat[t_queueRidx]--) {
t_queueRidx = (t_queueRidx + 1) % AUDIO_QUEUE_LENGTH;
@@ -132,7 +124,6 @@ void audioQueue::playNow(uint8_t tFreq, uint8_t tLen, uint8_t tPause,
tonePause = tPause;
#if defined(HAPTIC)
toneHaptic = tHaptic;
hapticTick = 0;
#endif
toneFreqIncr = tFreqIncr;
t_queueWidx = t_queueRidx;
@@ -237,8 +228,8 @@ void audioQueue::frskyevent(uint8_t e)
}
#endif
void audioQueue::event(uint8_t e, uint8_t f) {
void audioQueue::event(uint8_t e, uint8_t f)
{
uint8_t beepVal = g_eeGeneral.beeperVal;
switch (e) {