mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-19 14:48:03 +03:00
Ignore all long-press/function keys whilst in menu
This commit is contained in:
25
app/app.c
25
app/app.c
@ -677,17 +677,17 @@ static void MR_NextChannel(void)
|
||||
// this bit doesn't yet work if the other VFO is a frequency
|
||||
case SCAN_NEXT_CHAN_DUAL_WATCH:
|
||||
// dual watch is enabled - include the other VFO in the scan
|
||||
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF)
|
||||
{
|
||||
chan = (gEeprom.RX_VFO + 1) & 1u;
|
||||
chan = gEeprom.ScreenChannel[chan];
|
||||
if (IS_MR_CHANNEL(chan))
|
||||
{
|
||||
gCurrentScanList = SCAN_NEXT_CHAN_DUAL_WATCH;
|
||||
gNextMrChannel = chan;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF)
|
||||
// {
|
||||
// chan = (gEeprom.RX_VFO + 1) & 1u;
|
||||
// chan = gEeprom.ScreenChannel[chan];
|
||||
// if (IS_MR_CHANNEL(chan))
|
||||
// {
|
||||
// gCurrentScanList = SCAN_NEXT_CHAN_DUAL_WATCH;
|
||||
// gNextMrChannel = chan;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
default:
|
||||
case SCAN_NEXT_CHAN_MR:
|
||||
@ -2163,8 +2163,7 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
return;
|
||||
|
||||
if (!bKeyHeld)
|
||||
{
|
||||
// keypad is locked, tell the user
|
||||
{ // keypad is locked, tell the user
|
||||
AUDIO_PlayBeep(BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL);
|
||||
gKeypadLocked = 4; // 2 seconds
|
||||
gUpdateDisplay = true;
|
||||
|
@ -52,12 +52,22 @@ void GENERIC_Key_F(bool bKeyPressed, bool bKeyHeld)
|
||||
if (!bKeyPressed)
|
||||
return;
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = gEeprom.KEY_LOCK ? VOICE_ID_UNLOCK : VOICE_ID_LOCK;
|
||||
#endif
|
||||
|
||||
gEeprom.KEY_LOCK = !gEeprom.KEY_LOCK;
|
||||
gRequestSaveSettings = true;
|
||||
if (gScreenToDisplay != DISPLAY_MENU &&
|
||||
gScreenToDisplay != DISPLAY_FM &&
|
||||
#ifdef ENABLE_FMRADIO
|
||||
!gFmRadioMode &&
|
||||
#endif
|
||||
gCurrentFunction != FUNCTION_TRANSMIT)
|
||||
{ // toggle the keyboad lock
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = gEeprom.KEY_LOCK ? VOICE_ID_UNLOCK : VOICE_ID_LOCK;
|
||||
#endif
|
||||
|
||||
gEeprom.KEY_LOCK = !gEeprom.KEY_LOCK;
|
||||
|
||||
gRequestSaveSettings = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
23
app/main.c
23
app/main.c
@ -40,6 +40,9 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
|
||||
uint8_t Band;
|
||||
uint8_t Vfo = gEeprom.TX_VFO;
|
||||
|
||||
if (gScreenToDisplay == DISPLAY_MENU)
|
||||
return;
|
||||
|
||||
switch (Key)
|
||||
{
|
||||
case KEY_0:
|
||||
@ -560,30 +563,16 @@ static void MAIN_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
||||
gCssScanMode == CSS_SCAN_MODE_OFF)
|
||||
{ // copy channel to VFO
|
||||
|
||||
//const unsigned int vfo = (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF) ? gEeprom.RX_VFO : gEeprom.TX_VFO;
|
||||
unsigned int vfo = gEeprom.TX_VFO;
|
||||
if (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_CHAN_B)
|
||||
vfo = 1;
|
||||
else
|
||||
if (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_CHAN_A)
|
||||
vfo = 0;
|
||||
else
|
||||
if (gEeprom.DUAL_WATCH == DUAL_WATCH_CHAN_B)
|
||||
vfo = 1;
|
||||
else
|
||||
if (gEeprom.DUAL_WATCH == DUAL_WATCH_CHAN_A)
|
||||
vfo = 0;
|
||||
if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF)
|
||||
vfo = (vfo + 1) & 1u;
|
||||
const unsigned int vfo = get_rx_VFO();
|
||||
|
||||
if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo]))
|
||||
{ // swap to the VFO
|
||||
|
||||
const unsigned int channel = FREQ_CHANNEL_FIRST + gEeprom.VfoInfo[vfo].Band;
|
||||
|
||||
gEeprom.ScreenChannel[vfo] = channel;
|
||||
gEeprom.ScreenChannel[vfo] = channel;
|
||||
gEeprom.VfoInfo[vfo].CHANNEL_SAVE = channel;
|
||||
gEeprom.TX_VFO = vfo;
|
||||
gEeprom.TX_VFO = vfo;
|
||||
|
||||
RADIO_SelectVfos();
|
||||
RADIO_ApplyOffset(gRxVfo);
|
||||
|
Reference in New Issue
Block a user