Minor cleanup of beep code.
This commit is contained in:
parent
463892e53e
commit
3ba094f633
|
|
@ -316,6 +316,16 @@ void vp_terminate()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void beep_flush()
|
||||||
|
{
|
||||||
|
if (currentBeepDuration > 0)
|
||||||
|
platform_beepStop();
|
||||||
|
|
||||||
|
currentBeepDuration = 0;
|
||||||
|
memset(beepSeriesBuffer, 0, sizeof(beepSeriesBuffer));
|
||||||
|
beepSeriesIndex=0;
|
||||||
|
}
|
||||||
|
|
||||||
void vp_stop()
|
void vp_stop()
|
||||||
{
|
{
|
||||||
voicePromptActive = false;
|
voicePromptActive = false;
|
||||||
|
|
@ -325,11 +335,7 @@ void vp_stop()
|
||||||
codec_stop();
|
codec_stop();
|
||||||
|
|
||||||
// If any beep is playing, immediately stop it.
|
// If any beep is playing, immediately stop it.
|
||||||
if (currentBeepDuration > 0)
|
beep_flush();
|
||||||
platform_beepStop();
|
|
||||||
|
|
||||||
memset(beepSeriesBuffer, 0, sizeof(beepSeriesBuffer));
|
|
||||||
beepSeriesIndex=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void vp_flush()
|
void vp_flush()
|
||||||
|
|
@ -497,8 +503,7 @@ static bool beep_tick()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memset(beepSeriesBuffer, 0, sizeof(beepSeriesBuffer));
|
beep_flush();
|
||||||
beepSeriesIndex=0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue