0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 14:21:25 +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

@ -27,8 +27,8 @@ ENABLE_SHOW_CHARGE_LEVEL := 1
ENABLE_REVERSE_BAT_SYMBOL := 1 ENABLE_REVERSE_BAT_SYMBOL := 1
ENABLE_CODE_SCAN_TIMEOUT := 0 ENABLE_CODE_SCAN_TIMEOUT := 0
ENABLE_AM_FIX := 1 ENABLE_AM_FIX := 1
ENABLE_AM_FIX_SHOW_DATA := 1 ENABLE_AM_FIX_SHOW_DATA := 0
ENABLE_SQUELCH_LOWER := 1 ENABLE_SQUELCH_LOWER := 0
ENABLE_RSSI_BAR := 1 ENABLE_RSSI_BAR := 1
ENABLE_AUDIO_BAR := 1 ENABLE_AUDIO_BAR := 1
#ENABLE_COPY_CHAN_TO_VFO := 1 #ENABLE_COPY_CHAN_TO_VFO := 1

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

Binary file not shown.

View File

@ -138,7 +138,9 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
gUpdateStatus = true; gUpdateStatus = true;
GUI_SelectNextDisplay(DISPLAY_MAIN); if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu
GUI_SelectNextDisplay(DISPLAY_MAIN);
return; return;
case FUNCTION_TRANSMIT: case FUNCTION_TRANSMIT:

View File

@ -218,7 +218,6 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure
if (Band > BAND7_470MHz) if (Band > BAND7_470MHz)
{ {
Band = BAND6_400MHz; Band = BAND6_400MHz;
// Band = FREQUENCY_GetBand(gEeprom.ScreenChannel[VFO]); // 1of11 bug fix, or have I broke it ?
} }
if (IS_MR_CHANNEL(Channel)) if (IS_MR_CHANNEL(Channel))
@ -548,7 +547,7 @@ void RADIO_SelectVfos(void)
void RADIO_SetupRegisters(bool bSwitchToFunction0) void RADIO_SetupRegisters(bool bSwitchToFunction0)
{ {
BK4819_FilterBandwidth_t Bandwidth; BK4819_FilterBandwidth_t Bandwidth = gRxVfo->CHANNEL_BANDWIDTH;
uint16_t InterruptMask; uint16_t InterruptMask;
uint32_t Frequency; uint32_t Frequency;
@ -558,7 +557,6 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28_GREEN, false); BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28_GREEN, false);
Bandwidth = gRxVfo->CHANNEL_BANDWIDTH;
switch (Bandwidth) switch (Bandwidth)
{ {
default: default:
@ -611,6 +609,7 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
BK4819_PickRXFilterPathBasedOnFrequency(Frequency); BK4819_PickRXFilterPathBasedOnFrequency(Frequency);
// what does this in do ?
BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2, true); BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2, true);
// AF RX Gain and DAC // AF RX Gain and DAC

View File

@ -80,6 +80,9 @@ center_line_t center_line = CENTER_LINE_NONE;
const unsigned int bar_width = LCD_WIDTH - 2 - bar_x; const unsigned int bar_width = LCD_WIDTH - 2 - bar_x;
unsigned int i; unsigned int i;
if (gScreenToDisplay != DISPLAY_MAIN)
return;
#if 1 #if 1
// TX audio level // TX audio level
@ -713,8 +716,8 @@ void UI_DisplayMain(void)
#ifdef ENABLE_AUDIO_BAR #ifdef ENABLE_AUDIO_BAR
if (gSetting_mic_bar && gCurrentFunction == FUNCTION_TRANSMIT) if (gSetting_mic_bar && gCurrentFunction == FUNCTION_TRANSMIT)
{ {
UI_DisplayAudioBar();
center_line = CENTER_LINE_AUDIO_BAR; center_line = CENTER_LINE_AUDIO_BAR;
UI_DisplayAudioBar();
} }
else else
#endif #endif
@ -722,9 +725,9 @@ void UI_DisplayMain(void)
#if defined(ENABLE_AM_FIX) && defined(ENABLE_AM_FIX_SHOW_DATA) #if defined(ENABLE_AM_FIX) && defined(ENABLE_AM_FIX_SHOW_DATA)
if (rx && gEeprom.VfoInfo[gEeprom.RX_CHANNEL].AM_mode && gSetting_AM_fix) if (rx && gEeprom.VfoInfo[gEeprom.RX_CHANNEL].AM_mode && gSetting_AM_fix)
{ {
center_line = CENTER_LINE_AM_FIX_DATA;
AM_fix_print_data(gEeprom.RX_CHANNEL, String); AM_fix_print_data(gEeprom.RX_CHANNEL, String);
UI_PrintStringSmall(String, 2, 0, 3); UI_PrintStringSmall(String, 2, 0, 3);
center_line = CENTER_LINE_AM_FIX_DATA;
} }
else else
#endif #endif
@ -732,8 +735,8 @@ void UI_DisplayMain(void)
#ifdef ENABLE_RSSI_BAR #ifdef ENABLE_RSSI_BAR
if (rx) if (rx)
{ {
UI_DisplayRSSIBar(gCurrentRSSI[gEeprom.RX_CHANNEL], false);
center_line = CENTER_LINE_RSSI; center_line = CENTER_LINE_RSSI;
UI_DisplayRSSIBar(gCurrentRSSI[gEeprom.RX_CHANNEL], false);
} }
else else
#endif #endif
@ -745,20 +748,20 @@ void UI_DisplayMain(void)
{ // show live DTMF decode { // show live DTMF decode
const unsigned int len = strlen(gDTMF_RX_live); const unsigned int len = strlen(gDTMF_RX_live);
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
center_line = CENTER_LINE_DTMF_DEC;
strcpy(String, "DTMF "); strcpy(String, "DTMF ");
strcat(String, gDTMF_RX_live + idx); strcat(String, gDTMF_RX_live + idx);
UI_PrintStringSmall(String, 2, 0, 3); UI_PrintStringSmall(String, 2, 0, 3);
center_line = CENTER_LINE_DTMF_DEC;
} }
#else #else
if (gSetting_live_DTMF_decoder && gDTMF_RX_index > 0) if (gSetting_live_DTMF_decoder && gDTMF_RX_index > 0)
{ // show live DTMF decode { // show live DTMF decode
const unsigned int len = gDTMF_RX_index; const unsigned int len = gDTMF_RX_index;
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
center_line = CENTER_LINE_DTMF_DEC;
strcpy(String, "DTMF "); strcpy(String, "DTMF ");
strcat(String, gDTMF_RX + idx); strcat(String, gDTMF_RX + idx);
UI_PrintStringSmall(String, 2, 0, 3); UI_PrintStringSmall(String, 2, 0, 3);
center_line = CENTER_LINE_DTMF_DEC;
} }
#endif #endif
@ -766,11 +769,11 @@ void UI_DisplayMain(void)
else else
if (gChargingWithTypeC) if (gChargingWithTypeC)
{ // charging .. show the battery state { // charging .. show the battery state
center_line = CENTER_LINE_CHARGE_DATA;
sprintf(String, "Charge %u.%02uV %u%%", sprintf(String, "Charge %u.%02uV %u%%",
gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100, gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100,
BATTERY_VoltsToPercent(gBatteryVoltageAverage)); BATTERY_VoltsToPercent(gBatteryVoltageAverage));
UI_PrintStringSmall(String, 2, 0, 3); UI_PrintStringSmall(String, 2, 0, 3);
center_line = CENTER_LINE_CHARGE_DATA;
} }
#endif #endif
} }

View File

@ -476,11 +476,41 @@ void UI_DisplayMenu(void)
case MENU_R_CTCS: case MENU_R_CTCS:
case MENU_T_CTCS: case MENU_T_CTCS:
if (gSubMenuSelection == 0) {
strcpy(String, "OFF"); #if 1
else unsigned int Code;
sprintf(String, "%u.%uHz", CTCSS_Options[gSubMenuSelection - 1] / 10, CTCSS_Options[gSubMenuSelection - 1] % 10); FREQ_Config_t *pConfig = (gMenuCursor == MENU_R_CTCS) ? &gTxVfo->freq_config_RX : &gTxVfo->freq_config_TX;
if (gSubMenuSelection == 0)
{
strcpy(String, "OFF");
if (pConfig->CodeType != CODE_TYPE_CONTINUOUS_TONE)
break;
Code = 0;
pConfig->CodeType = CODE_TYPE_OFF;
pConfig->Code = Code;
BK4819_ExitSubAu();
}
else
{
sprintf(String, "%u.%uHz", CTCSS_Options[gSubMenuSelection - 1] / 10, CTCSS_Options[gSubMenuSelection - 1] % 10);
pConfig->CodeType = CODE_TYPE_CONTINUOUS_TONE;
Code = gSubMenuSelection - 1;
pConfig->Code = Code;
BK4819_SetCTCSSFrequency(CTCSS_Options[Code]);
}
#else
if (gSubMenuSelection == 0)
strcpy(String, "OFF");
else
sprintf(String, "%u.%uHz", CTCSS_Options[gSubMenuSelection - 1] / 10, CTCSS_Options[gSubMenuSelection - 1] % 10);
#endif
break; break;
}
case MENU_SFT_D: case MENU_SFT_D:
strcpy(String, gSubMenu_SFT_D[gSubMenuSelection]); strcpy(String, gSubMenu_SFT_D[gSubMenuSelection]);
@ -518,6 +548,12 @@ void UI_DisplayMenu(void)
case MENU_SCR: case MENU_SCR:
strcpy(String, gSubMenu_SCRAMBLER[gSubMenuSelection]); strcpy(String, gSubMenu_SCRAMBLER[gSubMenuSelection]);
#if 1
if (gSubMenuSelection > 0 && gSetting_ScrambleEnable)
BK4819_EnableScramble(gSubMenuSelection - 1);
else
BK4819_DisableScramble();
#endif
break; break;
case MENU_VOX: case MENU_VOX: