#1692 - We flush the queue instead of stopping the audio (the TADA sound
is cut otherwise)
This commit is contained in:
@@ -931,6 +931,15 @@ void AudioQueue::stopAll()
|
|||||||
CoLeaveMutexSection(audioMutex);
|
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)
|
void audioEvent(uint8_t e, uint16_t f)
|
||||||
{
|
{
|
||||||
#if defined(HAPTIC)
|
#if defined(HAPTIC)
|
||||||
|
|||||||
@@ -163,6 +163,8 @@ class AudioQueue {
|
|||||||
|
|
||||||
void stopAll();
|
void stopAll();
|
||||||
|
|
||||||
|
void flush();
|
||||||
|
|
||||||
void pause(uint16_t tLen);
|
void pause(uint16_t tLen);
|
||||||
|
|
||||||
void stopSD();
|
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 PLAY_FILE(f, flags, id) audioQueue.playFile((f), (flags), (id))
|
||||||
#define STOP_PLAY(id) audioQueue.stopPlay((id))
|
#define STOP_PLAY(id) audioQueue.stopPlay((id))
|
||||||
#define AUDIO_RESET() audioQueue.stopAll()
|
#define AUDIO_RESET() audioQueue.stopAll()
|
||||||
|
#define AUDIO_FLUSH() audioQueue.flush()
|
||||||
|
|
||||||
#if defined(SDCARD)
|
#if defined(SDCARD)
|
||||||
extern tmr10ms_t timeAutomaticPromptsSilence;
|
extern tmr10ms_t timeAutomaticPromptsSilence;
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ void audioDefevent(uint8_t e);
|
|||||||
#define AUDIO_HEARTBEAT() audio.heartbeat()
|
#define AUDIO_HEARTBEAT() audio.heartbeat()
|
||||||
#define IS_AUDIO_BUSY() audio.busy()
|
#define IS_AUDIO_BUSY() audio.busy()
|
||||||
#define AUDIO_RESET()
|
#define AUDIO_RESET()
|
||||||
|
#define AUDIO_FLUSH()
|
||||||
|
|
||||||
#define PLAY_PHASE_OFF(phase)
|
#define PLAY_PHASE_OFF(phase)
|
||||||
#define PLAY_PHASE_ON(phase)
|
#define PLAY_PHASE_ON(phase)
|
||||||
|
|||||||
@@ -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) ;
|
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();
|
flightReset();
|
||||||
logicalSwitchesReset();
|
logicalSwitchesReset();
|
||||||
|
|
||||||
|
|||||||
@@ -969,7 +969,7 @@ void eeLoadModel(uint8_t id)
|
|||||||
eeCheck(true);
|
eeCheck(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
AUDIO_RESET();
|
AUDIO_FLUSH();
|
||||||
flightReset();
|
flightReset();
|
||||||
logicalSwitchesReset();
|
logicalSwitchesReset();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user