#1692 - We flush the queue instead of stopping the audio (the TADA sound

is cut otherwise)
This commit is contained in:
bsongis
2014-09-10 20:05:54 +02:00
parent 5254c553b2
commit 1f77806017
5 changed files with 15 additions and 2 deletions
+9
View File
@@ -931,6 +931,15 @@ void AudioQueue::stopAll()
CoLeaveMutexSection(audioMutex);
}
void AudioQueue::flush()
{
CoEnterMutexSection(audioMutex);
widx = ridx; // clean the queue
varioContext.clear();
backgroundContext.clear();
CoLeaveMutexSection(audioMutex);
}
void audioEvent(uint8_t e, uint16_t f)
{
#if defined(HAPTIC)
+3
View File
@@ -163,6 +163,8 @@ class AudioQueue {
void stopAll();
void flush();
void pause(uint16_t tLen);
void stopSD();
@@ -328,6 +330,7 @@ void pushPrompt(uint16_t prompt, uint8_t id=0);
#define PLAY_FILE(f, flags, id) audioQueue.playFile((f), (flags), (id))
#define STOP_PLAY(id) audioQueue.stopPlay((id))
#define AUDIO_RESET() audioQueue.stopAll()
#define AUDIO_FLUSH() audioQueue.flush()
#if defined(SDCARD)
extern tmr10ms_t timeAutomaticPromptsSilence;
+1
View File
@@ -154,6 +154,7 @@ void audioDefevent(uint8_t e);
#define AUDIO_HEARTBEAT() audio.heartbeat()
#define IS_AUDIO_BUSY() audio.busy()
#define AUDIO_RESET()
#define AUDIO_FLUSH()
#define PLAY_PHASE_OFF(phase)
#define PLAY_PHASE_ON(phase)
+1 -1
View File
@@ -385,7 +385,7 @@ void eeLoadModel(uint8_t id)
read32_eeprom_data((File_system[id+1].block_no << 12) + sizeof(struct t_eeprom_header), (uint8_t *)&g_model, size) ;
}
AUDIO_RESET();
AUDIO_FLUSH();
flightReset();
logicalSwitchesReset();
+1 -1
View File
@@ -969,7 +969,7 @@ void eeLoadModel(uint8_t id)
eeCheck(true);
}
AUDIO_RESET();
AUDIO_FLUSH();
flightReset();
logicalSwitchesReset();