Refactored to decouple vp_init from speaking of splash screen.
This commit is contained in:
parent
16d750c55c
commit
d5d49fbbb2
|
|
@ -223,5 +223,9 @@ vpQueueFlags_t vp_getVoiceLevelQueueFlags();
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void vp_playMenuBeepIfNeeded(bool firstItem);
|
void vp_playMenuBeepIfNeeded(bool firstItem);
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void vp_announceSplashScreen();
|
||||||
|
|
||||||
#endif // VOICE_PROMPT_UTILS_H
|
#endif // VOICE_PROMPT_UTILS_H
|
||||||
|
|
|
||||||
|
|
@ -236,8 +236,6 @@ typedef enum
|
||||||
vpModeSpecificInfo = 0x08,
|
vpModeSpecificInfo = 0x08,
|
||||||
vpPower = 0x10,
|
vpPower = 0x10,
|
||||||
vpBankNameOrAllChannels = 0x20,
|
vpBankNameOrAllChannels = 0x20,
|
||||||
vpSplashInfo = 0x40,
|
|
||||||
vpAllInfoExceptSplash = 0x3f,
|
|
||||||
vpAllInfo = 0xff
|
vpAllInfo = 0xff
|
||||||
}
|
}
|
||||||
vpSummaryInfoFlags_t;
|
vpSummaryInfoFlags_t;
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ void openrtx_init()
|
||||||
// Display splash screen, turn on backlight after a suitable time to
|
// Display splash screen, turn on backlight after a suitable time to
|
||||||
// hide random pixels during render process
|
// hide random pixels during render process
|
||||||
ui_drawSplashScreen(true);
|
ui_drawSplashScreen(true);
|
||||||
|
vp_announceSplashScreen();
|
||||||
gfx_render();
|
gfx_render();
|
||||||
sleepFor(0u, 30u);
|
sleepFor(0u, 30u);
|
||||||
platform_setBacklightLevel(state.settings.brightness);
|
platform_setBacklightLevel(state.settings.brightness);
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@
|
||||||
#include <beeps.h>
|
#include <beeps.h>
|
||||||
#include "interfaces/cps_io.h"
|
#include "interfaces/cps_io.h"
|
||||||
|
|
||||||
|
const uint16_t BOOT_MELODY[] = {400, 3, 600, 3, 800, 3, 0, 0};
|
||||||
|
|
||||||
static void clearCurrPromptIfNeeded(const vpQueueFlags_t flags)
|
static void clearCurrPromptIfNeeded(const vpQueueFlags_t flags)
|
||||||
{
|
{
|
||||||
if (flags & vpqInit)
|
if (flags & vpqInit)
|
||||||
|
|
@ -210,9 +212,6 @@ void vp_announceChannelSummary(const channel_t* channel,
|
||||||
localFlags |= vpqIncludeDescriptions;
|
localFlags |= vpqIncludeDescriptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((infoFlags & vpSplashInfo) != 0)
|
|
||||||
vp_queueStringTableEntry(¤tLanguage->openRTX);
|
|
||||||
|
|
||||||
// If VFO mode, announce VFO.
|
// If VFO mode, announce VFO.
|
||||||
// channelNumber will be 0 if called from VFO mode.
|
// channelNumber will be 0 if called from VFO mode.
|
||||||
if ((infoFlags & vpChannelNameOrVFO) != 0)
|
if ((infoFlags & vpChannelNameOrVFO) != 0)
|
||||||
|
|
@ -1037,3 +1036,33 @@ void vp_playMenuBeepIfNeeded(bool firstItem)
|
||||||
else
|
else
|
||||||
vp_beep(BEEP_MENU_ITEM, SHORT_BEEP);
|
vp_beep(BEEP_MENU_ITEM, SHORT_BEEP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void vp_announceSplashScreen()
|
||||||
|
{
|
||||||
|
if (state.settings.vpLevel < vpBeep)
|
||||||
|
return;
|
||||||
|
|
||||||
|
vp_flush();
|
||||||
|
|
||||||
|
if (state.settings.vpLevel == vpBeep)
|
||||||
|
{
|
||||||
|
vp_beepSeries(BOOT_MELODY);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
vpQueueFlags_t localFlags = vpqAddSeparatingSilence;
|
||||||
|
|
||||||
|
// Force on the descriptions for level 3.
|
||||||
|
if (state.settings.vpLevel == vpHigh)
|
||||||
|
{
|
||||||
|
localFlags |= vpqIncludeDescriptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
vp_queueStringTableEntry(¤tLanguage->openRTX);
|
||||||
|
vp_queuePrompt(PROMPT_VFO);
|
||||||
|
vp_announceFrequencies(state.channel.rx_frequency,
|
||||||
|
state.channel.tx_frequency,
|
||||||
|
localFlags);
|
||||||
|
vp_announceRadioMode(state.channel.mode, localFlags);
|
||||||
|
vp_play();
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@
|
||||||
|
|
||||||
static const uint32_t VOICE_PROMPTS_DATA_MAGIC = 0x5056; //'VP'
|
static const uint32_t VOICE_PROMPTS_DATA_MAGIC = 0x5056; //'VP'
|
||||||
static const uint32_t VOICE_PROMPTS_DATA_VERSION = 0x1000; // v1000 OpenRTX
|
static const uint32_t VOICE_PROMPTS_DATA_VERSION = 0x1000; // v1000 OpenRTX
|
||||||
const uint16_t BOOT_MELODY[] = {400, 3, 600, 3, 800, 3, 0, 0};
|
|
||||||
|
|
||||||
#define VOICE_PROMPTS_TOC_SIZE 350
|
#define VOICE_PROMPTS_TOC_SIZE 350
|
||||||
#define CODEC2_HEADER_SIZE 7
|
#define CODEC2_HEADER_SIZE 7
|
||||||
|
|
@ -387,16 +386,6 @@ void vp_init()
|
||||||
|
|
||||||
// Initialize codec2 module
|
// Initialize codec2 module
|
||||||
codec_init();
|
codec_init();
|
||||||
if (state.settings.vpLevel == vpBeep)
|
|
||||||
{
|
|
||||||
vp_beepSeries(BOOT_MELODY);
|
|
||||||
}
|
|
||||||
else if (state.settings.vpLevel > vpBeep)
|
|
||||||
{// announce the splash msg and VFO.
|
|
||||||
vpSummaryInfoFlags_t infoFlags = vpChannelNameOrVFO | vpFrequencies |
|
|
||||||
vpRadioMode | vpSplashInfo;
|
|
||||||
vp_announceChannelSummary(&state.channel, 0, 0, infoFlags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void vp_terminate()
|
void vp_terminate()
|
||||||
|
|
|
||||||
|
|
@ -1379,7 +1379,7 @@ void ui_updateFSM(bool *sync_rtx)
|
||||||
{// quick press repeat vp, long press summary.
|
{// quick press repeat vp, long press summary.
|
||||||
if (msg.long_press)
|
if (msg.long_press)
|
||||||
vp_announceChannelSummary(&state.channel, 0,
|
vp_announceChannelSummary(&state.channel, 0,
|
||||||
state.bank, vpAllInfoExceptSplash);
|
state.bank, vpAllInfo);
|
||||||
else
|
else
|
||||||
vp_replayLastPrompt();
|
vp_replayLastPrompt();
|
||||||
f1Handled = true;
|
f1Handled = true;
|
||||||
|
|
@ -1474,7 +1474,7 @@ void ui_updateFSM(bool *sync_rtx)
|
||||||
&state.channel,
|
&state.channel,
|
||||||
state.channel_index,
|
state.channel_index,
|
||||||
state.bank,
|
state.bank,
|
||||||
vpAllInfoExceptSplash);
|
vpAllInfo);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1525,7 +1525,7 @@ void ui_updateFSM(bool *sync_rtx)
|
||||||
{
|
{
|
||||||
vp_announceChannelSummary(&state.channel,
|
vp_announceChannelSummary(&state.channel,
|
||||||
state.channel_index+1,
|
state.channel_index+1,
|
||||||
state.bank, vpAllInfoExceptSplash);
|
state.bank, vpAllInfo);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue