diff --git a/openrtx/src/core/openrtx.c b/openrtx/src/core/openrtx.c index 8f3096af..7020e446 100644 --- a/openrtx/src/core/openrtx.c +++ b/openrtx/src/core/openrtx.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -43,6 +44,7 @@ void openrtx_init() gfx_init(); // Initialize display and graphics driver kbd_init(); // Initialize keyboard driver ui_init(); // Initialize user interface + vpCacheInit(); // Checks to see if voice prompts are loaded and initializes them #ifdef SCREEN_CONTRAST display_setContrast(state.settings.contrast); #endif diff --git a/openrtx/src/core/voicePrompts.c b/openrtx/src/core/voicePrompts.c index c7b57775..45ef3b22 100644 --- a/openrtx/src/core/voicePrompts.c +++ b/openrtx/src/core/voicePrompts.c @@ -21,6 +21,7 @@ #include #include #include +#include "interfaces/keyboard.h" #include "core/voicePrompts.h" #include "ui/UIStrings.h" #include @@ -104,8 +105,16 @@ void vpCacheInit(void) vpDataIsLoaded = false; //SPI_Flash_read(VOICE_PROMPTS_FLASH_HEADER_ADDRESS + sizeof(voicePromptsDataHeader_t), (uint8_t *)&tableOfContents, sizeof(uint32_t) * VOICE_PROMPTS_TOC_SIZE); vpFlashDataAddress = VOICE_PROMPTS_FLASH_HEADER_ADDRESS + sizeof(voicePromptsDataHeader_t) + sizeof(uint32_t)*VOICE_PROMPTS_TOC_SIZE ; } - if (!vpDataIsLoaded) - state.settings.vpLevel = vpNone; + if (vpDataIsLoaded) + {// if the hash key is down, set vpLevel to high, if beep or less. + if ((kbd_getKeys() & KEY_HASH) && (state.settings.vpLevel <= vpBeep)) + state.settings.vpLevel = vpHigh; + } + else + { // ensure we at least have beeps in the event no voice prompts are loaded. + if (state.settings.vpLevel > vpBeep) + state.settings.vpLevel = vpBeep; + } } bool vpCheckHeader(uint32_t *bufferAddress)