0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 06:39:49 +03:00

Menu remains on screen whilst TX'ing

This commit is contained in:
OneOfEleven
2023-10-03 00:14:36 +01:00
parent 87d1cf7c86
commit 2551077cef
13 changed files with 136 additions and 53 deletions

View File

@ -109,7 +109,7 @@ void ACTION_Monitor(void)
}
else
#endif
gRequestDisplayScreen = gScreenToDisplay;
gRequestDisplayScreen = gScreenToDisplay;
}
void ACTION_Scan(bool bRestart)
@ -251,7 +251,9 @@ void ACTION_Vox(void)
#endif
gFlagPrepareTX = true;
gRequestDisplayScreen = DISPLAY_MAIN;
// if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu
gRequestDisplayScreen = DISPLAY_MAIN;
}
#endif
@ -268,6 +270,7 @@ void ACTION_Vox(void)
gInputBoxIndex = 0;
gVoxResumeCountdown = 80;
gFlagReconfigureVfos = true;
gRequestDisplayScreen = DISPLAY_MAIN;
return;
}
@ -279,7 +282,8 @@ void ACTION_Vox(void)
FM_Start();
gInputBoxIndex = 0;
gInputBoxIndex = 0;
gRequestDisplayScreen = DISPLAY_FM;
}
}

View File

@ -157,6 +157,7 @@ static void APP_CheckForIncoming(void)
updateRSSI(gEeprom.RX_CHANNEL);
gUpdateRSSI = true;
}
return;
}
@ -223,7 +224,7 @@ static void APP_HandleIncoming(void)
if (gRxVfo->DTMF_DECODING_ENABLE || gSetting_KILLED)
{ // DTMF DCD is enabled
// DTMF_HandleRequest();
DTMF_HandleRequest();
if (gDTMF_CallState == DTMF_CALL_STATE_NONE)
{
@ -600,7 +601,10 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix)
if (Function == FUNCTION_MONITOR)
#endif
{ // squelch is disabled
GUI_SelectNextDisplay(DISPLAY_MAIN);
if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu
GUI_SelectNextDisplay(DISPLAY_MAIN);
return;
}
@ -1486,22 +1490,27 @@ void APP_TimeSlice10ms(void)
if (gAlarmState == ALARM_STATE_TXALARM)
{
gAlarmState = ALARM_STATE_ALARM;
RADIO_EnableCxCSS();
BK4819_SetupPowerAmplifier(0, 0);
BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1, false);
BK4819_Enable_AfDac_DiscMode_TxDsp();
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_RED, false);
GUI_DisplayScreen();
}
else
{
gAlarmState = ALARM_STATE_TXALARM;
GUI_DisplayScreen();
BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_RED, true);
RADIO_SetTxParameters();
BK4819_TransmitTone(true, 500);
SYSTEM_DelayMs(2);
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
gEnableSpeaker = true;
gAlarmToneCounter = 0;
}
@ -1588,7 +1597,9 @@ void APP_TimeSlice10ms(void)
gScanUseCssResult = false;
gScanProgressIndicator = 0;
gScanCssState = SCAN_CSS_STATE_SCANNING;
GUI_SelectNextDisplay(DISPLAY_SCANNER);
gUpdateStatus = true;
}
@ -1679,7 +1690,9 @@ void cancelUserInputModes(void)
gDTMF_InputMode = false;
gDTMF_InputIndex = 0;
gInputBoxIndex = 0;
gRequestDisplayScreen = DISPLAY_MAIN;
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
}
}
@ -2008,7 +2021,8 @@ void APP_TimeSlice500ms(void)
RADIO_SetupRegisters(true);
gRequestDisplayScreen = DISPLAY_MAIN;
// if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu
gRequestDisplayScreen = DISPLAY_MAIN;
}
#endif
@ -2098,17 +2112,17 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
SETTINGS_SaveChannel(gTxVfo->CHANNEL_SAVE, gEeprom.TX_CHANNEL, gTxVfo, gFlagSaveChannel);
gFlagSaveChannel = false;
RADIO_ConfigureChannel(gEeprom.TX_CHANNEL, VFO_CONFIGURE);
RADIO_SetupRegisters(true);
GUI_SelectNextDisplay(DISPLAY_MAIN);
}
}
else
{
if (Key != KEY_PTT)
{
if (gScreenToDisplay == DISPLAY_MENU) // 1of11
gMenuCountdown = menu_timeout_500ms;
}
BACKLIGHT_TurnOn();
@ -2293,9 +2307,11 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
{
case DISPLAY_MAIN:
MAIN_ProcessKeys(Key, bKeyPressed, bKeyHeld);
#ifdef ENABLE_MAIN_KEY_HOLD
bKeyHeld = false; // allow the channel setting to be saved
#endif
break;
#ifdef ENABLE_FMRADIO
@ -2401,6 +2417,7 @@ Skip:
if (!bKeyHeld)
{
SETTINGS_SaveChannel(gTxVfo->CHANNEL_SAVE, gEeprom.TX_CHANNEL, gTxVfo, gRequestSaveChannel);
if (gScreenToDisplay != DISPLAY_SCANNER)
if (gVfoConfigureMode == VFO_CONFIGURE_NONE) // 'if' is so as we don't wipe out previously setting this variable elsewhere
gVfoConfigureMode = VFO_CONFIGURE;
@ -2408,6 +2425,7 @@ Skip:
else
{
gFlagSaveChannel = gRequestSaveChannel;
if (gRequestDisplayScreen == DISPLAY_INVALID)
gRequestDisplayScreen = DISPLAY_MAIN;
}

View File

@ -86,7 +86,7 @@ void GENERIC_Key_F(bool bKeyPressed, bool bKeyHeld)
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
return;
}
#ifdef ENABLE_FMRADIO
if (gFM_ScanState == FM_SCAN_OFF)
{
@ -106,7 +106,7 @@ void GENERIC_Key_PTT(bool bKeyPressed)
if (!bKeyPressed)
{
if (gScreenToDisplay == DISPLAY_MAIN)
//if (gScreenToDisplay == DISPLAY_MAIN)
{
if (gCurrentFunction == FUNCTION_TRANSMIT)
{
@ -132,10 +132,9 @@ void GENERIC_Key_PTT(bool bKeyPressed)
RADIO_SetVfoState(VFO_STATE_NORMAL);
// beep when you release the PTT
//gBeepToPlay = BEEP_880HZ_40MS_OPTIONAL; // 1of11
if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu
gRequestDisplayScreen = DISPLAY_MAIN;
gRequestDisplayScreen = DISPLAY_MAIN;
return;
}
@ -149,7 +148,10 @@ void GENERIC_Key_PTT(bool bKeyPressed)
gPttDebounceCounter = 0;
gPttIsPressed = false;
gRequestDisplayScreen = DISPLAY_MAIN;
if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu
gRequestDisplayScreen = DISPLAY_MAIN;
return;
}
@ -160,17 +162,15 @@ void GENERIC_Key_PTT(bool bKeyPressed)
if (gCssScanMode == CSS_SCAN_MODE_OFF)
{
#ifdef ENABLE_FMRADIO
if (gScreenToDisplay == DISPLAY_MENU || gScreenToDisplay == DISPLAY_FM)
#else
if (gScreenToDisplay == DISPLAY_MENU)
if (gScreenToDisplay == DISPLAY_FM)
{
gRequestDisplayScreen = DISPLAY_MAIN;
gInputBoxIndex = 0;
gPttIsPressed = false;
gPttDebounceCounter = 0;
return;
}
#endif
{
gRequestDisplayScreen = DISPLAY_MAIN;
gInputBoxIndex = 0;
gPttIsPressed = false;
gPttDebounceCounter = 0;
return;
}
if (gScreenToDisplay != DISPLAY_SCANNER)
{
@ -213,21 +213,26 @@ void GENERIC_Key_PTT(bool bKeyPressed)
gDTMF_State = DTMF_STATE_0;
}
gRequestDisplayScreen = DISPLAY_MAIN;
if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu
gRequestDisplayScreen = DISPLAY_MAIN;
gDTMF_InputMode = false;
gDTMF_InputIndex = 0;
return;
}
gRequestDisplayScreen = DISPLAY_MAIN;
if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu
gRequestDisplayScreen = DISPLAY_MAIN;
gFlagPrepareTX = true;
gInputBoxIndex = 0;
return;
}
gRequestDisplayScreen = DISPLAY_MAIN;
if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu
gRequestDisplayScreen = DISPLAY_MAIN;
gEeprom.CROSS_BAND_RX_TX = gBackupCROSS_BAND_RX_TX;
gUpdateStatus = true;
gFlagStopScan = true;
@ -237,7 +242,9 @@ void GENERIC_Key_PTT(bool bKeyPressed)
else
{
MENU_StopCssScan();
gRequestDisplayScreen = DISPLAY_MENU;
if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu
gRequestDisplayScreen = DISPLAY_MENU;
}
}
#ifdef ENABLE_FMRADIO
@ -247,11 +254,10 @@ void GENERIC_Key_PTT(bool bKeyPressed)
gRequestDisplayScreen = DISPLAY_FM;
}
#endif
#ifdef ENABLE_VOICE
gAnotherVoiceID = VOICE_ID_SCANNING_STOP;
#endif
gPttWasPressed = true;
}

View File

@ -77,6 +77,7 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
gRequestSaveVFO = true;
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
gRequestDisplayScreen = DISPLAY_MAIN;
if (beep)
@ -101,6 +102,7 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep)
gRequestSaveSettings = 1;
gFlagReconfigureVfos = true;
gRequestDisplayScreen = DISPLAY_MAIN;
if (beep)
@ -644,6 +646,7 @@ static void MAIN_Key_STAR(bool bKeyPressed, bool bKeyHeld)
gDTMF_InputMode = true;
memmove(gDTMF_InputBox, gDTMF_String, sizeof(gDTMF_InputBox));
gDTMF_InputIndex = 0;
gRequestDisplayScreen = DISPLAY_MAIN;
return;
}
@ -801,7 +804,9 @@ void MAIN_ProcessKeys(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
DTMF_Append(Character);
gKeyInputCountdown = key_input_timeout_500ms;
gRequestDisplayScreen = DISPLAY_MAIN;
gPttWasReleased = true;
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
return;

View File

@ -401,9 +401,6 @@ void MENU_AcceptSetting(void)
case MENU_T_CTCS:
pConfig = &gTxVfo->freq_config_TX;
// Fallthrough
case MENU_R_CTCS:
if (gSubMenuSelection == 0)
{
@ -413,14 +410,20 @@ void MENU_AcceptSetting(void)
return;
}
Code = 0;
pConfig->Code = Code;
pConfig->CodeType = CODE_TYPE_OFF;
BK4819_ExitSubAu();
}
else
{
{
pConfig->CodeType = CODE_TYPE_CONTINUOUS_TONE;
Code = gSubMenuSelection - 1;
pConfig->Code = Code;
BK4819_SetCTCSSFrequency(CTCSS_Options[Code]);
}
pConfig->Code = Code;
gRequestSaveChannel = 1;
return;
@ -441,6 +444,12 @@ void MENU_AcceptSetting(void)
case MENU_SCR:
gTxVfo->SCRAMBLING_TYPE = gSubMenuSelection;
#if 0
if (gSubMenuSelection > 0 && gSetting_ScrambleEnable)
BK4819_EnableScramble(gSubMenuSelection - 1);
else
BK4819_DisableScramble();
#endif
gRequestSaveChannel = 1;
return;

View File

@ -92,6 +92,7 @@ static void SCANNER_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
{
case 0:
gRequestDisplayScreen = DISPLAY_MAIN;
gEeprom.CROSS_BAND_RX_TX = gBackupCROSS_BAND_RX_TX;
gUpdateStatus = true;
gFlagStopScan = true;