diff --git a/Makefile b/Makefile index 9fa0d86..464d859 100644 --- a/Makefile +++ b/Makefile @@ -8,27 +8,28 @@ ENABLE_OVERLAY := 0 ENABLE_LTO := 1 ENABLE_UART := 1 ENABLE_AIRCOPY := 0 -ENABLE_FMRADIO := 0 +ENABLE_FMRADIO := 1 ENABLE_NOAA := 0 ENABLE_VOICE := 0 +ENABLE_VOX := 0 ENABLE_ALARM := 0 -ENABLE_TX1750 := 0 +ENABLE_TX1750 := 1 ENABLE_BIG_FREQ := 0 ENABLE_SMALL_BOLD := 1 ENABLE_KEEP_MEM_NAME := 1 ENABLE_WIDE_RX := 1 ENABLE_TX_WHEN_AM := 0 -ENABLE_F_CAL_MENU := 1 +ENABLE_F_CAL_MENU := 0 ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1 ENABLE_MAIN_KEY_HOLD := 1 ENABLE_BOOT_BEEPS := 0 -ENABLE_COMPANDER := 1 +ENABLE_COMPANDER := 0 ENABLE_SHOW_CHARGE_LEVEL := 1 ENABLE_REVERSE_BAT_SYMBOL := 1 ENABLE_CODE_SCAN_TIMEOUT := 0 ENABLE_AM_FIX := 1 ENABLE_AM_FIX_SHOW_DATA := 1 -ENABLE_SQUELCH_MORE_SENSITIVE := 1 +ENABLE_SQUELCH_MORE_SENSITIVE := 0 ENABLE_FASTER_CHANNEL_SCAN := 0 ENABLE_RSSI_BAR := 1 ENABLE_AUDIO_BAR := 1 @@ -201,6 +202,9 @@ endif ifeq ($(ENABLE_VOICE),1) CFLAGS += -DENABLE_VOICE endif +ifeq ($(ENABLE_VOX),1) + CFLAGS += -DENABLE_VOX +endif ifeq ($(ENABLE_ALARM),1) CFLAGS += -DENABLE_ALARM endif diff --git a/README.md b/README.md index 2fb4e2b..a88a2d5 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ ENABLE_AIRCOPY := 0 easier to just enter frequency with but ENABLE_FMRADIO := 0 WBFM VHF broadcast band receiver ENABLE_NOAA := 0 everything NOAA (only of any use in the USA) ENABLE_VOICE := 0 want to hear voices ? +ENABLE_VOX := 0 ENABLE_ALARM := 0 TX alarms ENABLE_1750HZ := 0 side key 1750Hz TX tone (older style repeater access) ENABLE_BIG_FREQ := 0 big font frequencies (like original QS firmware) diff --git a/app/action.c b/app/action.c index 976952e..0e3ef9e 100644 --- a/app/action.c +++ b/app/action.c @@ -224,16 +224,18 @@ void ACTION_Scan(bool bRestart) } } -void ACTION_Vox(void) -{ - gEeprom.VOX_SWITCH = !gEeprom.VOX_SWITCH; - gRequestSaveSettings = true; - gFlagReconfigureVfos = true; - #ifdef ENABLE_VOICE - gAnotherVoiceID = VOICE_ID_VOX; - #endif - gUpdateStatus = true; -} +#ifdef ENABLE_VOX + void ACTION_Vox(void) + { + gEeprom.VOX_SWITCH = !gEeprom.VOX_SWITCH; + gRequestSaveSettings = true; + gFlagReconfigureVfos = true; + #ifdef ENABLE_VOICE + gAnotherVoiceID = VOICE_ID_VOX; + #endif + gUpdateStatus = true; + } +#endif #if defined(ENABLE_ALARM) || defined(ENABLE_TX1750) static void ACTION_AlarmOr1750(const bool b1750) @@ -268,7 +270,9 @@ void ACTION_Vox(void) FM_TurnOff(); gInputBoxIndex = 0; - gVoxResumeCountdown = 80; + #ifdef ENABLE_VOX + gVoxResumeCountdown = 80; + #endif gFlagReconfigureVfos = true; gRequestDisplayScreen = DISPLAY_MAIN; @@ -369,7 +373,9 @@ void ACTION_Handle(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld) ACTION_Scan(true); break; case ACTION_OPT_VOX: - ACTION_Vox(); + #ifdef ENABLE_VOX + ACTION_Vox(); + #endif break; case ACTION_OPT_ALARM: #ifdef ENABLE_ALARM diff --git a/app/action.h b/app/action.h index c42de66..3008d4e 100644 --- a/app/action.h +++ b/app/action.h @@ -23,7 +23,9 @@ void ACTION_Power(void); void ACTION_Monitor(void); void ACTION_Scan(bool bFlag); -void ACTION_Vox(void); +#ifdef ENABLE_VOX + void ACTION_Vox(void); +#endif #ifdef ENABLE_ALARM //static void ACTION_AlarmOr1750(bool b1750) #endif diff --git a/app/app.c b/app/app.c index 6dfa3e7..86b0588 100644 --- a/app/app.c +++ b/app/app.c @@ -486,7 +486,7 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix) gEnableSpeaker = true; - if (gSetting_backlight_on_rx) + if (gSetting_backlight_on_tx_rx) BACKLIGHT_TurnOn(); if (gScanState != SCAN_OFF) @@ -850,36 +850,38 @@ void APP_CheckRadioInterrupts(void) if (interrupt_status_bits & BK4819_REG_02_CTCSS_FOUND) g_CTCSS_Lost = false; - if (interrupt_status_bits & BK4819_REG_02_VOX_LOST) - { - g_VOX_Lost = true; - gVoxPauseCountdown = 10; - - if (gEeprom.VOX_SWITCH) + #ifdef ENABLE_VOX + if (interrupt_status_bits & BK4819_REG_02_VOX_LOST) { - if (gCurrentFunction == FUNCTION_POWER_SAVE && !gRxIdleMode) + g_VOX_Lost = true; + gVoxPauseCountdown = 10; + + if (gEeprom.VOX_SWITCH) { - gPowerSave_10ms = power_save2_10ms; - gPowerSaveCountdownExpired = 0; - } - - if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF && (gScheduleDualWatch || gDualWatchCountdown_10ms < dual_watch_count_after_vox_10ms)) - { - gDualWatchCountdown_10ms = dual_watch_count_after_vox_10ms; - gScheduleDualWatch = false; - - // let the user see DW is not active - gDualWatchActive = false; - gUpdateStatus = true; + if (gCurrentFunction == FUNCTION_POWER_SAVE && !gRxIdleMode) + { + gPowerSave_10ms = power_save2_10ms; + gPowerSaveCountdownExpired = 0; + } + + if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF && (gScheduleDualWatch || gDualWatchCountdown_10ms < dual_watch_count_after_vox_10ms)) + { + gDualWatchCountdown_10ms = dual_watch_count_after_vox_10ms; + gScheduleDualWatch = false; + + // let the user see DW is not active + gDualWatchActive = false; + gUpdateStatus = true; + } } } - } - if (interrupt_status_bits & BK4819_REG_02_VOX_FOUND) - { - g_VOX_Lost = false; - gVoxPauseCountdown = 0; - } + if (interrupt_status_bits & BK4819_REG_02_VOX_FOUND) + { + g_VOX_Lost = false; + gVoxPauseCountdown = 0; + } + #endif if (interrupt_status_bits & BK4819_REG_02_SQUELCH_LOST) { @@ -934,83 +936,85 @@ void APP_EndTransmission(void) RADIO_SetupRegisters(false); } -static void APP_HandleVox(void) -{ - if (gSetting_KILLED) - return; - - if (gVoxResumeCountdown == 0) +#ifdef ENABLE_VOX + static void APP_HandleVox(void) { - if (gVoxPauseCountdown) + if (gSetting_KILLED) return; - } - else - { - g_VOX_Lost = false; - gVoxPauseCountdown = 0; - } - - #ifdef ENABLE_FMRADIO - if (gFmRadioMode) - return; - #endif - - if (gCurrentFunction == FUNCTION_RECEIVE || gCurrentFunction == FUNCTION_MONITOR) - return; - - if (gScanState != SCAN_OFF || gCssScanMode != CSS_SCAN_MODE_OFF) - return; - - if (gVOX_NoiseDetected) - { - if (g_VOX_Lost) - gVoxStopCountdown_10ms = vox_stop_count_down_10ms; - else - if (gVoxStopCountdown_10ms == 0) - gVOX_NoiseDetected = false; - - if (gCurrentFunction == FUNCTION_TRANSMIT && !gPttIsPressed && !gVOX_NoiseDetected) + + if (gVoxResumeCountdown == 0) { - if (gFlagEndTransmission) - { - //if (gCurrentFunction != FUNCTION_FOREGROUND) - FUNCTION_Select(FUNCTION_FOREGROUND); - } + if (gVoxPauseCountdown) + return; + } + else + { + g_VOX_Lost = false; + gVoxPauseCountdown = 0; + } + + #ifdef ENABLE_FMRADIO + if (gFmRadioMode) + return; + #endif + + if (gCurrentFunction == FUNCTION_RECEIVE || gCurrentFunction == FUNCTION_MONITOR) + return; + + if (gScanState != SCAN_OFF || gCssScanMode != CSS_SCAN_MODE_OFF) + return; + + if (gVOX_NoiseDetected) + { + if (g_VOX_Lost) + gVoxStopCountdown_10ms = vox_stop_count_down_10ms; else + if (gVoxStopCountdown_10ms == 0) + gVOX_NoiseDetected = false; + + if (gCurrentFunction == FUNCTION_TRANSMIT && !gPttIsPressed && !gVOX_NoiseDetected) { - APP_EndTransmission(); - - if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0) + if (gFlagEndTransmission) { //if (gCurrentFunction != FUNCTION_FOREGROUND) FUNCTION_Select(FUNCTION_FOREGROUND); } else - gRTTECountdown = gEeprom.REPEATER_TAIL_TONE_ELIMINATION * 10; + { + APP_EndTransmission(); + + if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0) + { + //if (gCurrentFunction != FUNCTION_FOREGROUND) + FUNCTION_Select(FUNCTION_FOREGROUND); + } + else + gRTTECountdown = gEeprom.REPEATER_TAIL_TONE_ELIMINATION * 10; + } + + gUpdateStatus = true; + gUpdateDisplay = true; + gFlagEndTransmission = false; } - - gUpdateStatus = true; - gUpdateDisplay = true; - gFlagEndTransmission = false; + return; } - return; - } - - if (g_VOX_Lost) - { - gVOX_NoiseDetected = true; - - if (gCurrentFunction == FUNCTION_POWER_SAVE) - FUNCTION_Select(FUNCTION_FOREGROUND); - - if (gCurrentFunction != FUNCTION_TRANSMIT && gSerialConfigCountDown_500ms == 0) + + if (g_VOX_Lost) { - gDTMF_ReplyState = DTMF_REPLY_NONE; - RADIO_PrepareTX(); - gUpdateDisplay = true; + gVOX_NoiseDetected = true; + + if (gCurrentFunction == FUNCTION_POWER_SAVE) + FUNCTION_Select(FUNCTION_FOREGROUND); + + if (gCurrentFunction != FUNCTION_TRANSMIT && gSerialConfigCountDown_500ms == 0) + { + gDTMF_ReplyState = DTMF_REPLY_NONE; + RADIO_PrepareTX(); + gUpdateDisplay = true; + } } } -} +#endif void APP_Update(void) { @@ -1144,8 +1148,10 @@ void APP_Update(void) } #endif - if (gEeprom.VOX_SWITCH) - APP_HandleVox(); + #ifdef ENABLE_VOX + if (gEeprom.VOX_SWITCH) + APP_HandleVox(); + #endif if (gSchedulePowerSave) { @@ -1210,8 +1216,10 @@ void APP_Update(void) { BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable(); - if (gEeprom.VOX_SWITCH) - BK4819_EnableVox(gEeprom.VOX1_THRESHOLD, gEeprom.VOX0_THRESHOLD); + #ifdef ENABLE_VOX + if (gEeprom.VOX_SWITCH) + BK4819_EnableVox(gEeprom.VOX1_THRESHOLD, gEeprom.VOX0_THRESHOLD); + #endif if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF && gScanState == SCAN_OFF && @@ -1447,11 +1455,13 @@ void APP_TimeSlice10ms(void) if (gFlashLightState == FLASHLIGHT_BLINK && (gFlashLightBlinkCounter & 15u) == 0) GPIO_FlipBit(&GPIOC->DATA, GPIOC_PIN_FLASHLIGHT); - if (gVoxResumeCountdown > 0) - gVoxResumeCountdown--; - - if (gVoxPauseCountdown > 0) - gVoxPauseCountdown--; + #ifdef ENABLE_VOX + if (gVoxResumeCountdown > 0) + gVoxResumeCountdown--; + + if (gVoxPauseCountdown > 0) + gVoxPauseCountdown--; + #endif if (gCurrentFunction == FUNCTION_TRANSMIT) { @@ -1997,7 +2007,9 @@ void APP_TimeSlice500ms(void) RADIO_EnableCxCSS(); } - gVoxResumeCountdown = 80; + #ifdef ENABLE_VOX + gVoxResumeCountdown = 80; + #endif SYSTEM_DelayMs(5); diff --git a/app/generic.c b/app/generic.c index fb378c1..a335fde 100644 --- a/app/generic.c +++ b/app/generic.c @@ -127,7 +127,9 @@ void GENERIC_Key_PTT(bool bKeyPressed) } gFlagEndTransmission = false; - gVOX_NoiseDetected = false; + #ifdef ENABLE_VOX + gVOX_NoiseDetected = false; + #endif } RADIO_SetVfoState(VFO_STATE_NORMAL); diff --git a/app/main.c b/app/main.c index e617c92..02ecae3 100644 --- a/app/main.c +++ b/app/main.c @@ -209,7 +209,15 @@ static void processFKeyFunction(const KEY_Code_t Key, const bool beep) break; case KEY_7: - ACTION_Vox(); + #ifdef ENABLE_VOX + ACTION_Vox(); + #else + + + // TODO: make use of the function key press + + + #endif break; case KEY_8: diff --git a/app/menu.c b/app/menu.c index 89edb72..fcf0ef8 100644 --- a/app/menu.c +++ b/app/menu.c @@ -219,7 +219,7 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax) #ifdef ENABLE_AUDIO_BAR case MENU_MIC_BAR: #endif - case MENU_ABR_ON_RX: + case MENU_ABR_ON_TX_RX: case MENU_BCL: case MENU_BEEP: case MENU_AUTOLK: @@ -253,7 +253,9 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax) *pMax = ARRAY_SIZE(gSubMenu_TOT) - 1; break; - case MENU_VOX: + #ifdef ENABLE_VOX + case MENU_VOX: + #endif case MENU_RP_STE: *pMin = 0; *pMax = 10; @@ -499,21 +501,23 @@ void MENU_AcceptSetting(void) gEeprom.BATTERY_SAVE = gSubMenuSelection; break; - case MENU_VOX: - gEeprom.VOX_SWITCH = gSubMenuSelection != 0; - if (gEeprom.VOX_SWITCH) - gEeprom.VOX_LEVEL = gSubMenuSelection - 1; - BOARD_EEPROM_LoadMoreSettings(); - gFlagReconfigureVfos = true; - gUpdateStatus = true; - break; + #ifdef ENABLE_VOX + case MENU_VOX: + gEeprom.VOX_SWITCH = gSubMenuSelection != 0; + if (gEeprom.VOX_SWITCH) + gEeprom.VOX_LEVEL = gSubMenuSelection - 1; + BOARD_EEPROM_LoadMoreSettings(); + gFlagReconfigureVfos = true; + gUpdateStatus = true; + break; + #endif case MENU_ABR: gEeprom.BACKLIGHT = gSubMenuSelection; break; - case MENU_ABR_ON_RX: - gSetting_backlight_on_rx = gSubMenuSelection; + case MENU_ABR_ON_TX_RX: + gSetting_backlight_on_tx_rx = gSubMenuSelection; break; case MENU_TDR: @@ -917,10 +921,12 @@ void MENU_ShowCurrentSetting(void) gSubMenuSelection = gEeprom.BATTERY_SAVE; break; - case MENU_VOX: - gSubMenuSelection = gEeprom.VOX_SWITCH ? gEeprom.VOX_LEVEL + 1 : 0; - break; - + #ifdef ENABLE_VOX + case MENU_VOX: + gSubMenuSelection = gEeprom.VOX_SWITCH ? gEeprom.VOX_LEVEL + 1 : 0; + break; + #endif + case MENU_ABR: gSubMenuSelection = gEeprom.BACKLIGHT; @@ -928,8 +934,8 @@ void MENU_ShowCurrentSetting(void) GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT); // turn the backlight ON while in backlight menu break; - case MENU_ABR_ON_RX: - gSubMenuSelection = gSetting_backlight_on_rx; + case MENU_ABR_ON_TX_RX: + gSubMenuSelection = gSetting_backlight_on_tx_rx; break; case MENU_TDR: diff --git a/app/scanner.c b/app/scanner.c index 1035547..9b821c0 100644 --- a/app/scanner.c +++ b/app/scanner.c @@ -412,7 +412,9 @@ void SCANNER_Start(void) g_CDCSS_Lost = false; gCDCSSCodeType = 0; g_CTCSS_Lost = false; - g_VOX_Lost = false; + #ifdef ENABLE_VOX + g_VOX_Lost = false; + #endif g_SquelchLost = false; gScannerEditState = 0; gScanProgressIndicator = 0; diff --git a/audio.c b/audio.c index 8ded14b..671d386 100644 --- a/audio.c +++ b/audio.c @@ -187,7 +187,9 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep) GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH); - gVoxResumeCountdown = 80; + #ifdef ENABLE_VOX + gVoxResumeCountdown = 80; + #endif SYSTEM_DelayMs(5); BK4819_TurnsOffTones_TurnsOnRX(); @@ -269,7 +271,11 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep) #endif GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH); - gVoxResumeCountdown = 2000; + + #ifdef ENABLE_VOX + gVoxResumeCountdown = 2000; + #endif + SYSTEM_DelayMs(5); AUDIO_PlayVoice(VoiceID); @@ -295,7 +301,11 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep) gVoiceWriteIndex = 0; gVoiceReadIndex = 0; - gVoxResumeCountdown = 80; + + #ifdef ENABLE_VOX + gVoxResumeCountdown = 80; + #endif + return; } @@ -408,7 +418,10 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep) gCountdownToPlayNextVoice_10ms = Delay; gFlagPlayQueuedVoice = false; - gVoxResumeCountdown = 2000; + + #ifdef ENABLE_VOX + gVoxResumeCountdown = 2000; + #endif return; } @@ -427,7 +440,10 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep) if (!gEnableSpeaker) GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH); - gVoxResumeCountdown = 80; + #ifdef ENABLE_VOX + gVoxResumeCountdown = 80; + #endif + gVoiceWriteIndex = 0; gVoiceReadIndex = 0; } diff --git a/bitmaps.c b/bitmaps.c index 0f6b6de..6907912 100644 --- a/bitmaps.c +++ b/bitmaps.c @@ -138,27 +138,29 @@ const uint8_t BITMAP_F_Key[6] = 0b01000001 }; -const uint8_t BITMAP_VOX[18] = -{ // "VOX" - 0b00000000, - 0b00011111, - 0b00100000, - 0b01000000, - 0b00100000, - 0b00011111, - 0b00000000, - 0b00111110, - 0b01000001, - 0b01000001, - 0b01000001, - 0b00111110, - 0b00000000, - 0b01100011, - 0b00010100, - 0b00001000, - 0b00010100, - 0b01100011 -}; +#ifdef ENABLE_VOX + const uint8_t BITMAP_VOX[18] = + { // "VOX" + 0b00000000, + 0b00011111, + 0b00100000, + 0b01000000, + 0b00100000, + 0b00011111, + 0b00000000, + 0b00111110, + 0b01000001, + 0b01000001, + 0b01000001, + 0b00111110, + 0b00000000, + 0b01100011, + 0b00010100, + 0b00001000, + 0b00010100, + 0b01100011 + }; +#endif #if 0 const uint8_t BITMAP_WX[12] = diff --git a/bitmaps.h b/bitmaps.h index 51e2fbb..64251e9 100644 --- a/bitmaps.h +++ b/bitmaps.h @@ -21,7 +21,9 @@ extern const uint8_t BITMAP_KeyLock[6]; extern const uint8_t BITMAP_F_Key[6]; -extern const uint8_t BITMAP_VOX[18]; +#ifdef ENABLE_VOX + extern const uint8_t BITMAP_VOX[18]; +#endif #if 0 extern const uint8_t BITMAP_WX[12]; diff --git a/board.c b/board.c index 2a9ca2c..23e7ab6 100644 --- a/board.c +++ b/board.c @@ -532,8 +532,10 @@ void BOARD_EEPROM_Init(void) gEeprom.NOAA_AUTO_SCAN = (Data[3] < 2) ? Data[3] : false; #endif gEeprom.KEY_LOCK = (Data[4] < 2) ? Data[4] : false; - gEeprom.VOX_SWITCH = (Data[5] < 2) ? Data[5] : false; - gEeprom.VOX_LEVEL = (Data[6] < 10) ? Data[6] : 1; + #ifdef ENABLE_VOX + gEeprom.VOX_SWITCH = (Data[5] < 2) ? Data[5] : false; + gEeprom.VOX_LEVEL = (Data[6] < 10) ? Data[6] : 1; + #endif gEeprom.MIC_SENSITIVITY = (Data[7] < 5) ? Data[7] : 4; // 0E78..0E7F @@ -712,7 +714,7 @@ void BOARD_EEPROM_Init(void) #ifdef ENABLE_AM_FIX gSetting_AM_fix = (Data[7] & (1u << 5)) ? true : false; #endif - gSetting_backlight_on_rx = (Data[7] & (1u << 6)) ? true : false; + gSetting_backlight_on_tx_rx = (Data[7] & (1u << 6)) ? true : false; if (!gEeprom.VFO_OPEN) { @@ -757,9 +759,11 @@ void BOARD_EEPROM_LoadMoreSettings(void) } gBatteryCalibration[5] = 2300; - EEPROM_ReadBuffer(0x1F50 + (gEeprom.VOX_LEVEL * 2), &gEeprom.VOX1_THRESHOLD, 2); - EEPROM_ReadBuffer(0x1F68 + (gEeprom.VOX_LEVEL * 2), &gEeprom.VOX0_THRESHOLD, 2); - + #ifdef ENABLE_VOX + EEPROM_ReadBuffer(0x1F50 + (gEeprom.VOX_LEVEL * 2), &gEeprom.VOX1_THRESHOLD, 2); + EEPROM_ReadBuffer(0x1F68 + (gEeprom.VOX_LEVEL * 2), &gEeprom.VOX0_THRESHOLD, 2); + #endif + //EEPROM_ReadBuffer(0x1F80 + gEeprom.MIC_SENSITIVITY, &Mic, 1); //gEeprom.MIC_SENSITIVITY_TUNING = (Mic < 32) ? Mic : 15; gEeprom.MIC_SENSITIVITY_TUNING = gMicGain_dB2[gEeprom.MIC_SENSITIVITY]; diff --git a/firmware.bin b/firmware.bin index 9ff38ee..2b13c78 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 3d44e17..6ae441b 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/functions.c b/functions.c index 232a01b..397e8be 100644 --- a/functions.c +++ b/functions.c @@ -22,6 +22,7 @@ #endif #include "bsp/dp32g030/gpio.h" #include "dcs.h" +#include "driver/backlight.h" #if defined(ENABLE_FMRADIO) #include "driver/bk1080.h" #endif @@ -55,12 +56,15 @@ void FUNCTION_Init(void) #endif DTMF_clear_RX(); - + g_CxCSS_TAIL_Found = false; g_CDCSS_Lost = false; g_CTCSS_Lost = false; - - g_VOX_Lost = false; + + #ifdef ENABLE_VOX + g_VOX_Lost = false; + #endif + g_SquelchLost = false; gFlagTailNoteEliminationComplete = false; @@ -117,35 +121,35 @@ void FUNCTION_Select(FUNCTION_Type_t Function) gUpdateStatus = true; return; - + case FUNCTION_MONITOR: gMonitor = true; break; - + case FUNCTION_INCOMING: case FUNCTION_RECEIVE: break; - + case FUNCTION_POWER_SAVE: gPowerSave_10ms = gEeprom.BATTERY_SAVE * 10; gPowerSaveCountdownExpired = false; gRxIdleMode = true; - + gMonitor = false; - BK4819_DisableVox(); + BK4819_DisableVox(); BK4819_Sleep(); - + BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2, false); gUpdateStatus = true; if (gScreenToDisplay != DISPLAY_MENU) // 1of11 .. don't close the menu GUI_SelectNextDisplay(DISPLAY_MAIN); - + return; - + case FUNCTION_TRANSMIT: // if DTMF is enabled when TX'ing, it changes the TX audio filtering !! .. 1of11 @@ -158,7 +162,7 @@ void FUNCTION_Select(FUNCTION_Type_t Function) gDTMF_RX_live_timeout = 0; gDTMF_RX_live_timeout = 0; memset(gDTMF_RX_live, 0, sizeof(gDTMF_RX_live)); - + #if defined(ENABLE_FMRADIO) if (gFmRadioMode) BK1080_Init(0, false); @@ -188,7 +192,7 @@ void FUNCTION_Select(FUNCTION_Type_t Function) break; } #endif - + gUpdateStatus = true; GUI_DisplayScreen(); @@ -197,9 +201,9 @@ void FUNCTION_Select(FUNCTION_Type_t Function) // turn the RED LED on BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_RED, true); - + DTMF_Reply(); - + #if defined(ENABLE_ALARM) || defined(ENABLE_TX1750) if (gAlarmState != ALARM_STATE_OFF) { @@ -226,6 +230,9 @@ void FUNCTION_Select(FUNCTION_Type_t Function) else BK4819_DisableScramble(); + if (gSetting_backlight_on_tx_rx) + BACKLIGHT_TurnOn(); + break; case FUNCTION_BAND_SCOPE: diff --git a/helper/boot.c b/helper/boot.c index 981910b..a0e6d6d 100644 --- a/helper/boot.c +++ b/helper/boot.c @@ -75,7 +75,9 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode) { gEeprom.DUAL_WATCH = DUAL_WATCH_OFF; gEeprom.BATTERY_SAVE = 0; - gEeprom.VOX_SWITCH = false; + #ifdef ENABLE_VOX + gEeprom.VOX_SWITCH = false; + #endif gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF; gEeprom.AUTO_KEYPAD_LOCK = false; gEeprom.KEY_1_SHORT_PRESS_ACTION = ACTION_OPT_NONE; diff --git a/misc.c b/misc.c index e9fa122..a02485c 100644 --- a/misc.c +++ b/misc.c @@ -45,7 +45,9 @@ const uint16_t dual_watch_count_after_rx_10ms = 1000 / 10; // 1 sec afte const uint16_t dual_watch_count_after_1_10ms = 5000 / 10; // 5 sec const uint16_t dual_watch_count_after_2_10ms = 3600 / 10; // 3.6 sec const uint16_t dual_watch_count_noaa_10ms = 70 / 10; // 70ms -const uint16_t dual_watch_count_after_vox_10ms = 200 / 10; // 200ms +#ifdef ENABLE_VOX + const uint16_t dual_watch_count_after_vox_10ms = 200 / 10; // 200ms +#endif const uint16_t dual_watch_count_toggle_10ms = 100 / 10; // 100ms between VFO toggles const uint16_t scan_pause_delay_in_1_10ms = 5000 / 10; // 5 seconds @@ -61,7 +63,9 @@ const uint16_t battery_save_count_10ms = 10000 / 10; // 10 seconds const uint16_t power_save1_10ms = 100 / 10; // 100ms const uint16_t power_save2_10ms = 200 / 10; // 200ms -const uint16_t vox_stop_count_down_10ms = 1000 / 10; // 1 second +#ifdef ENABLE_VOX + const uint16_t vox_stop_count_down_10ms = 1000 / 10; // 1 second +#endif const uint16_t NOAA_countdown_10ms = 5000 / 10; // 5 seconds const uint16_t NOAA_countdown_2_10ms = 500 / 10; // 500ms @@ -83,7 +87,7 @@ bool gSetting_TX_EN; uint8_t gSetting_F_LOCK; bool gSetting_ScrambleEnable; -bool gSetting_backlight_on_rx; +bool gSetting_backlight_on_tx_rx; #ifdef ENABLE_AM_FIX bool gSetting_AM_fix; @@ -188,12 +192,14 @@ bool g_CDCSS_Lost; uint8_t gCDCSSCodeType; bool g_CTCSS_Lost; bool g_CxCSS_TAIL_Found; -bool g_VOX_Lost; +#ifdef ENABLE_VOX + bool g_VOX_Lost; + bool gVOX_NoiseDetected; + uint16_t gVoxResumeCountdown; + uint16_t gVoxPauseCountdown; +#endif bool g_SquelchLost; uint8_t gFlashLightState; -bool gVOX_NoiseDetected; -uint16_t gVoxResumeCountdown; -uint16_t gVoxPauseCountdown; volatile uint16_t gFlashLightBlinkCounter; bool gFlagEndTransmission; uint16_t gLowBatteryCountdown; @@ -234,7 +240,9 @@ uint8_t gShowChPrefix; volatile bool gNextTimeslice; volatile uint8_t gFoundCDCSSCountdown_10ms; volatile uint8_t gFoundCTCSSCountdown_10ms; -volatile uint16_t gVoxStopCountdown_10ms; +#ifdef ENABLE_VOX + volatile uint16_t gVoxStopCountdown_10ms; +#endif volatile bool gNextTimeslice40ms; #ifdef ENABLE_NOAA volatile uint16_t gNOAACountdown_10ms = 0; diff --git a/misc.h b/misc.h index f229649..af5d707 100644 --- a/misc.h +++ b/misc.h @@ -116,7 +116,9 @@ extern const uint16_t battery_save_count_10ms; extern const uint16_t power_save1_10ms; extern const uint16_t power_save2_10ms; -extern const uint16_t vox_stop_count_down_10ms; +#ifdef ENABLE_VOX + extern const uint16_t vox_stop_count_down_10ms; +#endif extern const uint16_t NOAA_countdown_10ms; extern const uint16_t NOAA_countdown_2_10ms; @@ -128,7 +130,9 @@ extern const uint16_t dual_watch_count_after_1_10ms; extern const uint16_t dual_watch_count_after_2_10ms; extern const uint16_t dual_watch_count_toggle_10ms; extern const uint16_t dual_watch_count_noaa_10ms; -extern const uint16_t dual_watch_count_after_vox_10ms; +#ifdef ENABLE_VOX + extern const uint16_t dual_watch_count_after_vox_10ms; +#endif extern const uint16_t scan_pause_delay_in_1_10ms; extern const uint16_t scan_pause_delay_in_2_10ms; @@ -152,7 +156,7 @@ extern bool gSetting_TX_EN; extern uint8_t gSetting_F_LOCK; extern bool gSetting_ScrambleEnable; -extern bool gSetting_backlight_on_rx; +extern bool gSetting_backlight_on_tx_rx; #ifdef ENABLE_AM_FIX extern bool gSetting_AM_fix; @@ -258,12 +262,14 @@ extern bool g_CDCSS_Lost; extern uint8_t gCDCSSCodeType; extern bool g_CTCSS_Lost; extern bool g_CxCSS_TAIL_Found; -extern bool g_VOX_Lost; +#ifdef ENABLE_VOX + extern bool g_VOX_Lost; + extern bool gVOX_NoiseDetected; + extern uint16_t gVoxResumeCountdown; + extern uint16_t gVoxPauseCountdown; +#endif extern bool g_SquelchLost; extern uint8_t gFlashLightState; -extern bool gVOX_NoiseDetected; -extern uint16_t gVoxResumeCountdown; -extern uint16_t gVoxPauseCountdown; extern volatile uint16_t gFlashLightBlinkCounter; extern bool gFlagEndTransmission; extern uint16_t gLowBatteryCountdown; @@ -300,7 +306,9 @@ extern bool gF_LOCK; extern uint8_t gShowChPrefix; extern volatile uint8_t gFoundCDCSSCountdown_10ms; extern volatile uint8_t gFoundCTCSSCountdown_10ms; -extern volatile uint16_t gVoxStopCountdown_10ms; +#ifdef ENABLE_VOX + extern volatile uint16_t gVoxStopCountdown_10ms; +#endif extern volatile bool gNextTimeslice40ms; #ifdef ENABLE_NOAA extern volatile uint16_t gNOAACountdown_10ms; diff --git a/radio.c b/radio.c index cde6aaa..95dd923 100644 --- a/radio.c +++ b/radio.c @@ -698,24 +698,26 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0) } #endif - #ifdef ENABLE_NOAA - #ifdef ENABLE_FMRADIO - if (gEeprom.VOX_SWITCH && !gFmRadioMode && IS_NOT_NOAA_CHANNEL(gCurrentVfo->CHANNEL_SAVE) && gCurrentVfo->AM_mode == 0) + #ifdef ENABLE_VOX + #ifdef ENABLE_NOAA + #ifdef ENABLE_FMRADIO + if (gEeprom.VOX_SWITCH && !gFmRadioMode && IS_NOT_NOAA_CHANNEL(gCurrentVfo->CHANNEL_SAVE) && gCurrentVfo->AM_mode == 0) + #else + if (gEeprom.VOX_SWITCH && IS_NOT_NOAA_CHANNEL(gCurrentVfo->CHANNEL_SAVE) && gCurrentVfo->AM_mode == 0) + #endif #else - if (gEeprom.VOX_SWITCH && IS_NOT_NOAA_CHANNEL(gCurrentVfo->CHANNEL_SAVE) && gCurrentVfo->AM_mode == 0) - #endif - #else - #ifdef ENABLE_FMRADIO - if (gEeprom.VOX_SWITCH && !gFmRadioMode && gCurrentVfo->AM_mode == 0) - #else - if (gEeprom.VOX_SWITCH && gCurrentVfo->AM_mode == 0) + #ifdef ENABLE_FMRADIO + if (gEeprom.VOX_SWITCH && !gFmRadioMode && gCurrentVfo->AM_mode == 0) + #else + if (gEeprom.VOX_SWITCH && gCurrentVfo->AM_mode == 0) + #endif #endif + { + BK4819_EnableVox(gEeprom.VOX1_THRESHOLD, gEeprom.VOX0_THRESHOLD); + InterruptMask |= BK4819_REG_3F_VOX_FOUND | BK4819_REG_3F_VOX_LOST; + } + else #endif - { - BK4819_EnableVox(gEeprom.VOX1_THRESHOLD, gEeprom.VOX0_THRESHOLD); - InterruptMask |= BK4819_REG_3F_VOX_FOUND | BK4819_REG_3F_VOX_LOST; - } - else BK4819_DisableVox(); #ifdef ENABLE_COMPANDER diff --git a/scheduler.c b/scheduler.c index 21ae085..03cf9a2 100644 --- a/scheduler.c +++ b/scheduler.c @@ -104,7 +104,9 @@ void SystickHandler(void) DECREMENT_AND_TRIGGER(gFmPlayCountdown_10ms, gScheduleFM); #endif - DECREMENT(gVoxStopCountdown_10ms); + #ifdef ENABLE_VOX + DECREMENT(gVoxStopCountdown_10ms); + #endif DECREMENT(boot_counter_10ms); } diff --git a/settings.c b/settings.c index aa60e2d..f8bfeb3 100644 --- a/settings.c +++ b/settings.c @@ -86,8 +86,13 @@ void SETTINGS_SaveSettings(void) State[3] = false; #endif State[4] = gEeprom.KEY_LOCK; - State[5] = gEeprom.VOX_SWITCH; - State[6] = gEeprom.VOX_LEVEL; + #ifdef ENABLE_VOX + State[5] = gEeprom.VOX_SWITCH; + State[6] = gEeprom.VOX_LEVEL; + #else + State[5] = false; + State[6] = 0; + #endif State[7] = gEeprom.MIC_SENSITIVITY; EEPROM_WriteBuffer(0x0E70, State); @@ -174,7 +179,7 @@ void SETTINGS_SaveSettings(void) #ifdef ENABLE_AM_FIX if (!gSetting_AM_fix) State[7] &= ~(1u << 5); #endif - if (!gSetting_backlight_on_rx) State[7] &= ~(1u << 6); + if (!gSetting_backlight_on_tx_rx) State[7] &= ~(1u << 6); EEPROM_WriteBuffer(0x0F40, State); } diff --git a/ui/menu.c b/ui/menu.c index 38bd7aa..d860463 100644 --- a/ui/menu.c +++ b/ui/menu.c @@ -43,97 +43,99 @@ const t_menu_item MenuList[] = { // text, voice ID, menu ID - {"SQL", VOICE_ID_SQUELCH, MENU_SQL }, - {"STEP", VOICE_ID_FREQUENCY_STEP, MENU_STEP }, - {"T PWR", VOICE_ID_POWER, MENU_TXP }, // was "TXP" - {"R DCS", VOICE_ID_DCS, MENU_R_DCS }, // was "R_DCS" - {"R CTCS", VOICE_ID_CTCSS, MENU_R_CTCS }, // was "R_CTCS" - {"T DCS", VOICE_ID_DCS, MENU_T_DCS }, // was "T_DCS" - {"T CTCS", VOICE_ID_CTCSS, MENU_T_CTCS }, // was "T_CTCS" - {"T DIR", VOICE_ID_TX_OFFSET_FREQUENCY_DIRECTION, MENU_SFT_D }, // was "SFT_D" - {"T OFFS", VOICE_ID_TX_OFFSET_FREQUENCY, MENU_OFFSET }, // was "OFFSET" - {"T VFO", VOICE_ID_INVALID, MENU_XB }, // was "WX" - {"T TOUT", VOICE_ID_TRANSMIT_OVER_TIME, MENU_TOT }, // was "TOT" - {"W/N", VOICE_ID_CHANNEL_BANDWIDTH, MENU_W_N }, - {"SCRAM", VOICE_ID_SCRAMBLER_ON, MENU_SCR }, // was "SCR" - {"BUSYCL", VOICE_ID_BUSY_LOCKOUT, MENU_BCL }, // was "BCL" - {"CH SAV", VOICE_ID_MEMORY_CHANNEL, MENU_MEM_CH }, // was "MEM-CH" - {"CH DEL", VOICE_ID_DELETE_CHANNEL, MENU_DEL_CH }, // was "DEL-CH" - {"CH NAM", VOICE_ID_INVALID, MENU_MEM_NAME }, - {"CH DIS", VOICE_ID_INVALID, MENU_MDF }, // was "MDF" - {"BATSAV", VOICE_ID_SAVE_MODE, MENU_SAVE }, // was "SAVE" - {"VOX", VOICE_ID_VOX, MENU_VOX }, - {"BLT", VOICE_ID_INVALID, MENU_ABR }, // was "ABR" - {"BLT RX", VOICE_ID_INVALID, MENU_ABR_ON_RX }, - {"DUALRX", VOICE_ID_DUAL_STANDBY, MENU_TDR }, // was "TDR" - {"BEEP", VOICE_ID_BEEP_PROMPT, MENU_BEEP }, -#ifdef ENABLE_VOICE - {"VOICE", VOICE_ID_VOICE_PROMPT, MENU_VOICE }, + {"SQL", VOICE_ID_SQUELCH, MENU_SQL }, + {"STEP", VOICE_ID_FREQUENCY_STEP, MENU_STEP }, + {"T PWR", VOICE_ID_POWER, MENU_TXP }, // was "TXP" + {"R DCS", VOICE_ID_DCS, MENU_R_DCS }, // was "R_DCS" + {"R CTCS", VOICE_ID_CTCSS, MENU_R_CTCS }, // was "R_CTCS" + {"T DCS", VOICE_ID_DCS, MENU_T_DCS }, // was "T_DCS" + {"T CTCS", VOICE_ID_CTCSS, MENU_T_CTCS }, // was "T_CTCS" + {"T DIR", VOICE_ID_TX_OFFSET_FREQUENCY_DIRECTION, MENU_SFT_D }, // was "SFT_D" + {"T OFFS", VOICE_ID_TX_OFFSET_FREQUENCY, MENU_OFFSET }, // was "OFFSET" + {"T VFO", VOICE_ID_INVALID, MENU_XB }, // was "WX" + {"T TOUT", VOICE_ID_TRANSMIT_OVER_TIME, MENU_TOT }, // was "TOT" + {"W/N", VOICE_ID_CHANNEL_BANDWIDTH, MENU_W_N }, + {"SCRAM", VOICE_ID_SCRAMBLER_ON, MENU_SCR }, // was "SCR" + {"BUSYCL", VOICE_ID_BUSY_LOCKOUT, MENU_BCL }, // was "BCL" + {"CH SAV", VOICE_ID_MEMORY_CHANNEL, MENU_MEM_CH }, // was "MEM-CH" + {"CH DEL", VOICE_ID_DELETE_CHANNEL, MENU_DEL_CH }, // was "DEL-CH" + {"CH NAM", VOICE_ID_INVALID, MENU_MEM_NAME }, + {"CH DIS", VOICE_ID_INVALID, MENU_MDF }, // was "MDF" + {"BATSAV", VOICE_ID_SAVE_MODE, MENU_SAVE }, // was "SAVE" +#ifdef ENABLE_VOX + {"VOX", VOICE_ID_VOX, MENU_VOX }, #endif - {"SC REV", VOICE_ID_INVALID, MENU_SC_REV }, - {"KEYLOC", VOICE_ID_INVALID, MENU_AUTOLK }, // was "AUTOLk" - {"S ADD1", VOICE_ID_INVALID, MENU_S_ADD1 }, - {"S ADD2", VOICE_ID_INVALID, MENU_S_ADD2 }, - {"STE", VOICE_ID_INVALID, MENU_STE }, - {"RP STE", VOICE_ID_INVALID, MENU_RP_STE }, - {"MIC", VOICE_ID_INVALID, MENU_MIC }, + {"BLT", VOICE_ID_INVALID, MENU_ABR }, // was "ABR" + {"BLTTRX", VOICE_ID_INVALID, MENU_ABR_ON_TX_RX }, + {"DUALRX", VOICE_ID_DUAL_STANDBY, MENU_TDR }, // was "TDR" + {"BEEP", VOICE_ID_BEEP_PROMPT, MENU_BEEP }, +#ifdef ENABLE_VOICE + {"VOICE", VOICE_ID_VOICE_PROMPT, MENU_VOICE }, +#endif + {"SC REV", VOICE_ID_INVALID, MENU_SC_REV }, + {"KEYLOC", VOICE_ID_INVALID, MENU_AUTOLK }, // was "AUTOLk" + {"S ADD1", VOICE_ID_INVALID, MENU_S_ADD1 }, + {"S ADD2", VOICE_ID_INVALID, MENU_S_ADD2 }, + {"STE", VOICE_ID_INVALID, MENU_STE }, + {"RP STE", VOICE_ID_INVALID, MENU_RP_STE }, + {"MIC", VOICE_ID_INVALID, MENU_MIC }, #ifdef ENABLE_AUDIO_BAR - {"MICBAR", VOICE_ID_INVALID, MENU_MIC_BAR }, + {"MICBAR", VOICE_ID_INVALID, MENU_MIC_BAR }, #endif #ifdef ENABLE_COMPANDER - {"COMPND", VOICE_ID_INVALID, MENU_COMPAND }, + {"COMPND", VOICE_ID_INVALID, MENU_COMPAND }, #endif - {"1 CALL", VOICE_ID_INVALID, MENU_1_CALL }, - {"SLIST", VOICE_ID_INVALID, MENU_S_LIST }, - {"SLIST1", VOICE_ID_INVALID, MENU_SLIST1 }, - {"SLIST2", VOICE_ID_INVALID, MENU_SLIST2 }, + {"1 CALL", VOICE_ID_INVALID, MENU_1_CALL }, + {"SLIST", VOICE_ID_INVALID, MENU_S_LIST }, + {"SLIST1", VOICE_ID_INVALID, MENU_SLIST1 }, + {"SLIST2", VOICE_ID_INVALID, MENU_SLIST2 }, #ifdef ENABLE_ALARM - {"AL-MOD", VOICE_ID_INVALID, MENU_AL_MOD }, + {"AL-MOD", VOICE_ID_INVALID, MENU_AL_MOD }, #endif - {"ANI ID", VOICE_ID_ANI_CODE, MENU_ANI_ID }, - {"UPCODE", VOICE_ID_INVALID, MENU_UPCODE }, - {"DWCODE", VOICE_ID_INVALID, MENU_DWCODE }, - {"PTT ID", VOICE_ID_INVALID, MENU_PTT_ID }, - {"D ST", VOICE_ID_INVALID, MENU_D_ST }, - {"D RSP", VOICE_ID_INVALID, MENU_D_RSP }, - {"D HOLD", VOICE_ID_INVALID, MENU_D_HOLD }, - {"D PRE", VOICE_ID_INVALID, MENU_D_PRE }, - {"D DCD", VOICE_ID_INVALID, MENU_D_DCD }, - {"D LIST", VOICE_ID_INVALID, MENU_D_LIST }, - {"D LIVE", VOICE_ID_INVALID, MENU_D_LIVE_DEC }, // live DTMF decoder - {"PONMSG", VOICE_ID_INVALID, MENU_PONMSG }, - {"ROGER", VOICE_ID_INVALID, MENU_ROGER }, - {"BATVOL", VOICE_ID_INVALID, MENU_VOL }, // was "VOL" - {"BATTXT", VOICE_ID_INVALID, MENU_BAT_TXT }, - {"MODE", VOICE_ID_INVALID, MENU_AM }, // was "AM" + {"ANI ID", VOICE_ID_ANI_CODE, MENU_ANI_ID }, + {"UPCODE", VOICE_ID_INVALID, MENU_UPCODE }, + {"DWCODE", VOICE_ID_INVALID, MENU_DWCODE }, + {"PTT ID", VOICE_ID_INVALID, MENU_PTT_ID }, + {"D ST", VOICE_ID_INVALID, MENU_D_ST }, + {"D RSP", VOICE_ID_INVALID, MENU_D_RSP }, + {"D HOLD", VOICE_ID_INVALID, MENU_D_HOLD }, + {"D PRE", VOICE_ID_INVALID, MENU_D_PRE }, + {"D DCD", VOICE_ID_INVALID, MENU_D_DCD }, + {"D LIST", VOICE_ID_INVALID, MENU_D_LIST }, + {"D LIVE", VOICE_ID_INVALID, MENU_D_LIVE_DEC }, // live DTMF decoder + {"PONMSG", VOICE_ID_INVALID, MENU_PONMSG }, + {"ROGER", VOICE_ID_INVALID, MENU_ROGER }, + {"BATVOL", VOICE_ID_INVALID, MENU_VOL }, // was "VOL" + {"BATTXT", VOICE_ID_INVALID, MENU_BAT_TXT }, + {"MODE", VOICE_ID_INVALID, MENU_AM }, // was "AM" #ifdef ENABLE_AM_FIX - {"AM FIX", VOICE_ID_INVALID, MENU_AM_FIX }, + {"AM FIX", VOICE_ID_INVALID, MENU_AM_FIX }, #endif #ifdef ENABLE_AM_FIX_TEST1 - {"AM FT1", VOICE_ID_INVALID, MENU_AM_FIX_TEST1}, + {"AM FT1", VOICE_ID_INVALID, MENU_AM_FIX_TEST1 }, #endif #ifdef ENABLE_NOAA - {"NOAA-S", VOICE_ID_INVALID, MENU_NOAA_S }, + {"NOAA-S", VOICE_ID_INVALID, MENU_NOAA_S }, #endif - {"RESET", VOICE_ID_INITIALISATION, MENU_RESET }, // might be better to move this to the hidden menu items ? + {"RESET", VOICE_ID_INITIALISATION, MENU_RESET }, // might be better to move this to the hidden menu items ? // hidden menu items from here on // enabled if pressing both the PTT and upper side button at power-on - {"F LOCK", VOICE_ID_INVALID, MENU_F_LOCK }, - {"TX 200", VOICE_ID_INVALID, MENU_200TX }, // was "200TX" - {"TX 350", VOICE_ID_INVALID, MENU_350TX }, // was "350TX" - {"TX 500", VOICE_ID_INVALID, MENU_500TX }, // was "500TX" - {"350 EN", VOICE_ID_INVALID, MENU_350EN }, // was "350EN" - {"SCR EN", VOICE_ID_INVALID, MENU_SCREN }, // was "SCREN" + {"F LOCK", VOICE_ID_INVALID, MENU_F_LOCK }, + {"TX 200", VOICE_ID_INVALID, MENU_200TX }, // was "200TX" + {"TX 350", VOICE_ID_INVALID, MENU_350TX }, // was "350TX" + {"TX 500", VOICE_ID_INVALID, MENU_500TX }, // was "500TX" + {"350 EN", VOICE_ID_INVALID, MENU_350EN }, // was "350EN" + {"SCR EN", VOICE_ID_INVALID, MENU_SCREN }, // was "SCREN" - {"TX EN", VOICE_ID_INVALID, MENU_TX_EN }, // enable TX + {"TX EN", VOICE_ID_INVALID, MENU_TX_EN }, // enable TX #ifdef ENABLE_F_CAL_MENU - {"F CALI", VOICE_ID_INVALID, MENU_F_CALI }, // reference xtal calibration + {"F CALI", VOICE_ID_INVALID, MENU_F_CALI }, // reference xtal calibration #endif - {"BATCAL", VOICE_ID_INVALID, MENU_BATCAL }, // battery voltage calibration + {"BATCAL", VOICE_ID_INVALID, MENU_BATCAL }, // battery voltage calibration - {"", VOICE_ID_INVALID, 0xff } // end of list - DO NOT delete or move this this + {"", VOICE_ID_INVALID, 0xff } // end of list - DO NOT delete or move this this }; const char gSubMenu_TXP[3][5] = @@ -357,7 +359,7 @@ void UI_DisplayMenu(void) #if 0 // original menu layout - + for (i = 0; i < 3; i++) if (gMenuCursor > 0 || i > 0) if ((gMenuListCount - 1) != gMenuCursor || i != 2) @@ -513,7 +515,7 @@ void UI_DisplayMenu(void) break; } - + case MENU_SFT_D: strcpy(String, gSubMenu_SFT_D[gSubMenuSelection]); break; @@ -558,12 +560,14 @@ void UI_DisplayMenu(void) #endif break; - case MENU_VOX: - if (gSubMenuSelection == 0) - strcpy(String, "OFF"); - else - sprintf(String, "%d", gSubMenuSelection); - break; + #ifdef ENABLE_VOX + case MENU_VOX: + if (gSubMenuSelection == 0) + strcpy(String, "OFF"); + else + sprintf(String, "%d", gSubMenuSelection); + break; + #endif case MENU_ABR: strcpy(String, gSubMenu_BACKLIGHT[gSubMenuSelection]); @@ -593,7 +597,7 @@ void UI_DisplayMenu(void) #ifdef ENABLE_AM_FIX case MENU_AM_FIX: #endif - case MENU_ABR_ON_RX: + case MENU_ABR_ON_TX_RX: case MENU_BCL: case MENU_BEEP: case MENU_S_ADD1: @@ -787,9 +791,9 @@ void UI_DisplayMenu(void) { const uint32_t value = 22656 + gSubMenuSelection; const uint32_t xtal_Hz = (0x4f0000u + value) * 5; - + writeXtalFreqCal(gSubMenuSelection, false); - + sprintf(String, "%d\n%u.%06u\nMHz", gSubMenuSelection, xtal_Hz / 1000000, xtal_Hz % 1000000); diff --git a/ui/menu.h b/ui/menu.h index 9425844..01845e5 100644 --- a/ui/menu.h +++ b/ui/menu.h @@ -49,9 +49,11 @@ enum MENU_MEM_NAME, MENU_MDF, MENU_SAVE, +#ifdef ENABLE_VOX MENU_VOX, +#endif MENU_ABR, - MENU_ABR_ON_RX, + MENU_ABR_ON_TX_RX, MENU_TDR, MENU_BEEP, #ifdef ENABLE_VOICE diff --git a/ui/status.c b/ui/status.c index 3db670e..4fafd6a 100644 --- a/ui/status.c +++ b/ui/status.c @@ -131,13 +131,15 @@ void UI_DisplayStatus(const bool test_display) } x += sizeof(BITMAP_XB); - // VOX indicator - if (gEeprom.VOX_SWITCH || test_display) - { - memmove(line + x, BITMAP_VOX, sizeof(BITMAP_VOX)); - x1 = x + sizeof(BITMAP_VOX); - } - x += sizeof(BITMAP_VOX); + #ifdef ENABLE_VOX + // VOX indicator + if (gEeprom.VOX_SWITCH || test_display) + { + memmove(line + x, BITMAP_VOX, sizeof(BITMAP_VOX)); + x1 = x + sizeof(BITMAP_VOX); + } + x += sizeof(BITMAP_VOX); + #endif // KEY-LOCK indicator if (gEeprom.KEY_LOCK || test_display)