Partial fix for speaker pop when a voiceprompt begins
This commit is contained in:
parent
5ee3a2e9f0
commit
0692bea269
|
|
@ -412,14 +412,16 @@ void vp_terminate()
|
|||
void vp_stop()
|
||||
{
|
||||
voicePromptActive = false;
|
||||
disableSpkOutput();
|
||||
codec_stop();
|
||||
|
||||
// Clear voice prompt sequence data
|
||||
vpCurrentSequence.pos = 0;
|
||||
vpCurrentSequence.c2DataIndex = 0;
|
||||
vpCurrentSequence.c2DataLength = 0;
|
||||
codec_stop();
|
||||
|
||||
// If any beep is playing, immediately stop it.
|
||||
beep_flush();
|
||||
disableSpkOutput();
|
||||
}
|
||||
|
||||
void vp_flush()
|
||||
|
|
@ -562,8 +564,8 @@ void vp_play()
|
|||
|
||||
voicePromptActive = true;
|
||||
|
||||
enableSpkOutput();
|
||||
codec_startDecode(SINK_SPK);
|
||||
enableSpkOutput();
|
||||
}
|
||||
|
||||
void vp_tick()
|
||||
|
|
@ -619,11 +621,11 @@ void vp_tick()
|
|||
// see if we've finished.
|
||||
if(vpCurrentSequence.pos == vpCurrentSequence.length)
|
||||
{
|
||||
disableSpkOutput();
|
||||
voicePromptActive = false;
|
||||
vpCurrentSequence.pos = 0;
|
||||
vpCurrentSequence.c2DataIndex = 0;
|
||||
vpCurrentSequence.c2DataLength = 0;
|
||||
disableSpkOutput();
|
||||
codec_stop();
|
||||
}
|
||||
}
|
||||
|
|
@ -657,8 +659,8 @@ void vp_beep(uint16_t freq, uint16_t duration)
|
|||
beepSeriesBuffer[1].duration = 0;
|
||||
currentBeepDuration = duration;
|
||||
beepSeriesIndex = 0;
|
||||
enableSpkOutput();
|
||||
platform_beepStart(freq);
|
||||
enableSpkOutput();
|
||||
}
|
||||
|
||||
void vp_beepSeries(const uint16_t* beepSeries)
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ void audio_init()
|
|||
#endif
|
||||
#endif
|
||||
|
||||
gpio_setMode(BEEP_OUT, INPUT);
|
||||
|
||||
gpio_setPin(SPK_MUTE); // Speaker muted
|
||||
#ifndef PLATFORM_MD9600
|
||||
gpio_clearPin(AUDIO_AMP_EN); // Audio PA off
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ streamId outputStream_start(const enum AudioSink destination,
|
|||
NVIC_EnableIRQ(DMA1_Stream2_IRQn);
|
||||
|
||||
// Enable compare channel
|
||||
TIM3->CCR3 = 0;
|
||||
TIM3->CCR3 = buf[0];
|
||||
TIM3->CCER |= TIM_CCER_CC3E;
|
||||
TIM3->CR1 |= TIM_CR1_CEN;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue