From 07d971ecfb22e885b70aadbbc054069bbfec403c Mon Sep 17 00:00:00 2001 From: vk7js <58905135+vk7js@users.noreply.github.com> Date: Tue, 17 May 2022 21:36:57 +1000 Subject: [PATCH] Hooked up repeat last voice prompt and summary to f1 if vpLevel is higher than beep. --- openrtx/src/core/voicePromptUtils.c | 10 +++++++--- openrtx/src/ui/ui.c | 22 +++++++++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/openrtx/src/core/voicePromptUtils.c b/openrtx/src/core/voicePromptUtils.c index ed70b101..365748c7 100644 --- a/openrtx/src/core/voicePromptUtils.c +++ b/openrtx/src/core/voicePromptUtils.c @@ -155,7 +155,7 @@ void anouncePower(float power, VoicePromptQueueFlags_T flags) vpInitIfNeeded(flags); char buffer[16] = "\0"; -//joe + if (flags & vpqIncludeDescriptions) vpQueuePrompt(PROMPT_POWER); @@ -177,8 +177,12 @@ VoicePromptQueueFlags_T flags) VoicePromptQueueFlags_T localFlags=flags & ~(vpqInit | vpqPlayImmediately); if (state.settings.vpLevel == vpHigh) localFlags |= vpqIncludeDescriptions; - - announceChannelName(channel, channelIndex, localFlags); + // if VFO mode, announce VFO. + // channelIndex will be 0 if called from VFO mode. + if (channelIndex == 0) + vpQueuePrompt(PROMPT_VFO); + else + announceChannelName(channel, channelIndex, localFlags); announceFrequencies(channel->rx_frequency , channel->tx_frequency, localFlags); announceRadioMode(channel->mode, localFlags); diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index 271bcf5e..6ad5263e 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -1035,7 +1035,7 @@ void ui_updateFSM(bool *sync_rtx) { kbd_msg_t msg; msg.value = event.payload; - + bool f1Handled = false; // If we get out of standby, we ignore the kdb event // unless is the MONI key for the MACRO functions if (_ui_exitStandby(now) && !(msg.keys & KEY_MONI)) @@ -1158,7 +1158,7 @@ void ui_updateFSM(bool *sync_rtx) ui_state.input_number = input_getPressedNumber(msg); // Calculate portion of the new frequency ui_state.new_rx_frequency = _ui_freq_add_digit(ui_state.new_rx_frequency, - ui_state.input_position, ui_state.input_number); + ui_state.input_position, ui_state.input_number); } } break; @@ -1218,6 +1218,18 @@ void ui_updateFSM(bool *sync_rtx) else if(msg.keys & KEY_ESC) // Discard selected dst ID and disable input mode ui_state.edit_mode = false; + else if(msg.keys & KEY_F1) + { + if (state.settings.vpLevel > vpBeep) + {// quick press repeat vp, long press summary. + if (msg.long_press) + announceChannelSummary(&state.channel, state.channel_index, + (vpqInit|vpqPlayImmediately)); + else + ReplayLastPrompt(); + f1Handled=true; + } + } else if(msg.keys & KEY_UP || msg.keys & KEY_DOWN || msg.keys & KEY_LEFT || msg.keys & KEY_RIGHT) _ui_textInputDel(ui_state.new_callsign); @@ -1243,7 +1255,6 @@ void ui_updateFSM(bool *sync_rtx) *sync_rtx = true; // Switch to VFO screen state.ui_screen = MAIN_VFO; - announceVFO(); } else if(msg.keys & KEY_HASH) { @@ -1657,6 +1668,11 @@ void ui_updateFSM(bool *sync_rtx) } break; } + if (!f1Handled && (msg.keys & KEY_F1) && (state.settings.vpLevel > vpBeep)) + { + ReplayLastPrompt(); + } + } else if(event.type == EVENT_STATUS) {