diff --git a/openrtx/include/core/voicePromptUtils.h b/openrtx/include/core/voicePromptUtils.h index 0f79236b..de1d76a9 100644 --- a/openrtx/include/core/voicePromptUtils.h +++ b/openrtx/include/core/voicePromptUtils.h @@ -206,8 +206,7 @@ void vp_announceScreen(uint8_t ui_screen); * This function is called from ui_updateFSM to speak string buffers. */ void vp_announceBuffer(const char* const* stringTableStringPtr, bool editMode, - const char* buffer); - + bool callsign, const char* buffer); /** * diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index 35a5b583..20913ef4 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -750,12 +750,13 @@ void vp_announceScreen(uint8_t ui_screen) break; case SETTINGS_M17: vp_announceBuffer(¤tLanguage->callsign, - false, state.settings.callsign); + false, true, state.settings.callsign); break; } } -void vp_announceBuffer(const char* const* stringTableStringPtr, bool editMode, +void vp_announceBuffer(const char* const* stringTableStringPtr, + bool editMode, bool callsign, const char* buffer) { bool isPlaying=vp_isPlaying(); @@ -772,7 +773,8 @@ void vp_announceBuffer(const char* const* stringTableStringPtr, bool editMode, vpFlags_t flags= vpAnnounceCommonSymbols; // add edit mode flags to adjust what is spoken. - if (editMode) + // extra symbols not relevant when entering callsign. + if (editMode && !callsign) flags |= vpAnnounceLessCommonSymbols | vpAnnounceSpace | vpAnnounceASCIIValueForUnknownChars; vp_queueString(buffer, flags); diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index 2b5544da..38aea61e 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -1054,7 +1054,12 @@ static void _ui_textInputConfirm(char *buf) static void _ui_textInputDel(char *buf) { // announce the char about to be backspaced. - if(buf[ui_state.input_position]) + // Note this assumes editing callsign. + // If we edit a different buffer which allows the underline char, we may + // not want to exclude it, but when editing callsign, we do not want to say + // underline since it means the field is empty. + if(buf[ui_state.input_position] + && buf[ui_state.input_position]!='_') vp_announceInputChar(buf[ui_state.input_position]); buf[ui_state.input_position] = '\0'; @@ -1844,14 +1849,14 @@ void ui_updateFSM(bool *sync_rtx) ui_state.edit_mode = false; *sync_rtx = true; vp_announceBuffer(¤tLanguage->callsign, - false, state.settings.callsign); + false, true, state.settings.callsign); } else if(msg.keys & KEY_ESC) { // Discard selected callsign and disable input mode ui_state.edit_mode = false; vp_announceBuffer(¤tLanguage->callsign, - false, state.settings.callsign); + false, true, state.settings.callsign); } else if(msg.keys & KEY_UP || msg.keys & KEY_DOWN || msg.keys & KEY_LEFT || msg.keys & KEY_RIGHT) @@ -1861,7 +1866,7 @@ void ui_updateFSM(bool *sync_rtx) else if (msg.long_press && (msg.keys & KEY_F1) && (state.settings.vpLevel > vpBeep)) { vp_announceBuffer(¤tLanguage->callsign, - true, ui_state.new_callsign); + true, true, ui_state.new_callsign); f1Handled=true; } } @@ -1874,7 +1879,7 @@ void ui_updateFSM(bool *sync_rtx) // Reset text input variables _ui_textInputReset(ui_state.new_callsign); vp_announceBuffer(¤tLanguage->callsign, - true, ui_state.new_callsign); + true, true, ui_state.new_callsign); } else if(msg.keys & KEY_ESC) _ui_menuBack(MENU_SETTINGS);