Two fixes:

1x Added a rate limit on the ARM board to prevent speaker getting over-run on sound requests.  This limit has two parameters in the audio.h to set the length.  Value of 10 seems to work ok for now.   The fix resolves the broken sound when the vario limit was set to 0.
2x Adjusted all tonePause and toneLen for the events to suit the ARM board.  Issue is simply that the audio is processed much faster.. so the tunes where happening too fast!
This commit is contained in:
rob@marotori.com
2012-05-10 09:03:34 +00:00
parent e9e6cfd19b
commit 91dd67204b
2 changed files with 73 additions and 55 deletions
+5 -1
View File
@@ -35,11 +35,13 @@
#ifndef audio_h
#define audio_h
#define AUDIO_QUEUE_LENGTH (20)
#define AUDIO_QUEUE_LENGTH (100)
#define BEEP_DEFAULT_FREQ (70)
#define BEEP_OFFSET (10)
#define BEEP_KEY_UP_FREQ (BEEP_DEFAULT_FREQ+5)
#define BEEP_KEY_DOWN_FREQ (BEEP_DEFAULT_FREQ-5)
#define TONE1_RATE_LIMIT (10)
#define TONE2_RATE_LIMIT (10)
class audioQueue
{
@@ -78,12 +80,14 @@ class audioQueue
int8_t toneFreqIncr;
uint8_t toneTimeLeft;
uint8_t tonePause;
uint8_t toneRateLimit;
// vario
uint8_t tone2Changed;
uint8_t tone2Freq;
uint8_t tone2TimeLeft;
uint8_t tone2Pause;
uint8_t tone2RateLimit;
// queue arrays
uint8_t queueToneFreq[AUDIO_QUEUE_LENGTH];