0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 22:31:25 +03:00

More counter renames + dual watch active indicator

This commit is contained in:
OneOfEleven 2023-09-18 08:30:24 +01:00
parent 6cdd8f35b1
commit 777117c76b
23 changed files with 306 additions and 231 deletions

View File

@ -85,7 +85,7 @@ static void ACTION_Monitor(void)
if (gScanState != SCAN_OFF) if (gScanState != SCAN_OFF)
{ {
ScanPauseDelayIn10msec = 500; // 5 seconds ScanPauseDelayIn_10ms = 500; // 5 seconds
gScheduleScanListen = false; gScheduleScanListen = false;
gScanPauseMode = true; gScanPauseMode = true;
} }
@ -93,7 +93,7 @@ static void ACTION_Monitor(void)
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gIsNoaaMode) if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gIsNoaaMode)
{ {
gNOAA_Countdown = 500; gNOAA_Countdown_10ms = 500; // 5 sec
gScheduleNOAA = false; gScheduleNOAA = false;
} }
#endif #endif

166
app/app.c
View File

@ -16,7 +16,6 @@
#include <string.h> #include <string.h>
#include "scheduler.h"
#include "app/action.h" #include "app/action.h"
#ifdef ENABLE_AIRCOPY #ifdef ENABLE_AIRCOPY
#include "app/aircopy.h" #include "app/aircopy.h"
@ -73,7 +72,7 @@ static void APP_CheckForIncoming(void)
{ {
if (gCssScanMode != CSS_SCAN_MODE_OFF && gRxReceptionMode == RX_MODE_NONE) if (gCssScanMode != CSS_SCAN_MODE_OFF && gRxReceptionMode == RX_MODE_NONE)
{ {
ScanPauseDelayIn10msec = 100; // 1 second ScanPauseDelayIn_10ms = 100; // 1 second
gScheduleScanListen = false; gScheduleScanListen = false;
gRxReceptionMode = RX_MODE_DETECTED; gRxReceptionMode = RX_MODE_DETECTED;
} }
@ -83,7 +82,7 @@ static void APP_CheckForIncoming(void)
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
if (gIsNoaaMode) if (gIsNoaaMode)
{ {
gNOAA_Countdown = 20; gNOAA_Countdown_10ms = 20; // 200ms
gScheduleNOAA = false; gScheduleNOAA = false;
} }
#endif #endif
@ -98,8 +97,12 @@ static void APP_CheckForIncoming(void)
return; return;
} }
gDualWatchCountdown = dual_watch_count_after_rx_10ms; gDualWatchCountdown_10ms = dual_watch_count_after_rx_10ms;
gScheduleDualWatch = false; gDualWatchCountdownExpired = false;
// let the user see DW is not active
gDualWatchActive = false;
gUpdateStatus = true;
} }
else else
{ {
@ -109,7 +112,7 @@ static void APP_CheckForIncoming(void)
return; return;
} }
ScanPauseDelayIn10msec = 20; // 200ms ScanPauseDelayIn_10ms = 20; // 200ms
gScheduleScanListen = false; gScheduleScanListen = false;
} }
@ -132,10 +135,10 @@ static void APP_HandleIncoming(void)
bFlag = (gScanState == SCAN_OFF && gCurrentCodeType == CODE_TYPE_OFF); bFlag = (gScanState == SCAN_OFF && gCurrentCodeType == CODE_TYPE_OFF);
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE) && gSystickCountdown2) if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE) && gNOAACountdown_10ms > 0)
{ {
gNOAACountdown_10ms = 0;
bFlag = true; bFlag = true;
gSystickCountdown2 = 0;
} }
#endif #endif
@ -163,9 +166,15 @@ static void APP_HandleIncoming(void)
{ {
if (gRxReceptionMode == RX_MODE_DETECTED) if (gRxReceptionMode == RX_MODE_DETECTED)
{ {
gDualWatchCountdown = dual_watch_count_after_1_10ms; gDualWatchCountdown_10ms = dual_watch_count_after_1_10ms;
gScheduleDualWatch = false; gDualWatchCountdownExpired = false;
gRxReceptionMode = RX_MODE_LISTENING; gRxReceptionMode = RX_MODE_LISTENING;
// let the user see DW is not active
gDualWatchActive = false;
gUpdateStatus = true;
return; return;
} }
} }
@ -183,7 +192,7 @@ static void APP_HandleReceive(void)
uint8_t Mode = END_OF_RX_MODE_SKIP; uint8_t Mode = END_OF_RX_MODE_SKIP;
if (gFlagTteComplete) if (gFlagTailNoteEliminationComplete)
{ {
Mode = END_OF_RX_MODE_END; Mode = END_OF_RX_MODE_END;
goto Skip; goto Skip;
@ -205,7 +214,7 @@ static void APP_HandleReceive(void)
break; break;
case CODE_TYPE_CONTINUOUS_TONE: case CODE_TYPE_CONTINUOUS_TONE:
if (gFoundCTCSS && gFoundCTCSSCountdown == 0) if (gFoundCTCSS && gFoundCTCSSCountdown_10ms == 0)
{ {
gFoundCTCSS = false; gFoundCTCSS = false;
gFoundCDCSS = false; gFoundCDCSS = false;
@ -216,7 +225,7 @@ static void APP_HandleReceive(void)
case CODE_TYPE_DIGITAL: case CODE_TYPE_DIGITAL:
case CODE_TYPE_REVERSE_DIGITAL: case CODE_TYPE_REVERSE_DIGITAL:
if (gFoundCDCSS && gFoundCDCSSCountdown == 0) if (gFoundCDCSS && gFoundCDCSSCountdown_10ms == 0)
{ {
gFoundCTCSS = false; gFoundCTCSS = false;
gFoundCDCSS = false; gFoundCDCSS = false;
@ -256,7 +265,7 @@ static void APP_HandleReceive(void)
if (!gFoundCTCSS) if (!gFoundCTCSS)
{ {
gFoundCTCSS = true; gFoundCTCSS = true;
gFoundCTCSSCountdown = 100; gFoundCTCSSCountdown_10ms = 100; // 1 sec
} }
if (g_CxCSS_TAIL_Found) if (g_CxCSS_TAIL_Found)
@ -276,7 +285,7 @@ static void APP_HandleReceive(void)
if (!gFoundCDCSS) if (!gFoundCDCSS)
{ {
gFoundCDCSS = true; gFoundCDCSS = true;
gFoundCDCSSCountdown = 100; gFoundCDCSSCountdown_10ms = 100; // 1 sec
} }
if (g_CxCSS_TAIL_Found) if (g_CxCSS_TAIL_Found)
@ -315,7 +324,7 @@ Skip:
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE)) if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE))
gSystickCountdown2 = 300; gNOAACountdown_10ms = 300; // 3 sec
#endif #endif
gUpdateDisplay = true; gUpdateDisplay = true;
@ -328,7 +337,7 @@ Skip:
break; break;
case SCAN_RESUME_CO: case SCAN_RESUME_CO:
ScanPauseDelayIn10msec = 360; ScanPauseDelayIn_10ms = 360;
gScheduleScanListen = false; gScheduleScanListen = false;
break; break;
@ -345,10 +354,10 @@ Skip:
{ {
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH); GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_AUDIO_PATH);
gTailNoteEliminationCountdown = 20; gTailNoteEliminationCountdown_10ms = 20;
gFlagTteComplete = false; gFlagTailNoteEliminationComplete = false;
gEnableSpeaker = false;
gEndOfRxDetectedMaybe = true; gEndOfRxDetectedMaybe = true;
gEnableSpeaker = false;
} }
break; break;
} }
@ -407,7 +416,7 @@ void APP_StartListening(FUNCTION_Type_t Function)
case SCAN_RESUME_TO: case SCAN_RESUME_TO:
if (!gScanPauseMode) if (!gScanPauseMode)
{ {
ScanPauseDelayIn10msec = 500; ScanPauseDelayIn_10ms = 500;
gScheduleScanListen = false; gScheduleScanListen = false;
gScanPauseMode = true; gScanPauseMode = true;
} }
@ -415,7 +424,7 @@ void APP_StartListening(FUNCTION_Type_t Function)
case SCAN_RESUME_CO: case SCAN_RESUME_CO:
case SCAN_RESUME_SE: case SCAN_RESUME_SE:
ScanPauseDelayIn10msec = 0; ScanPauseDelayIn_10ms = 0;
gScheduleScanListen = false; gScheduleScanListen = false;
break; break;
} }
@ -430,7 +439,7 @@ void APP_StartListening(FUNCTION_Type_t Function)
gRxVfo->pRX->Frequency = NoaaFrequencyTable[gNoaaChannel]; gRxVfo->pRX->Frequency = NoaaFrequencyTable[gNoaaChannel];
gRxVfo->pTX->Frequency = NoaaFrequencyTable[gNoaaChannel]; gRxVfo->pTX->Frequency = NoaaFrequencyTable[gNoaaChannel];
gEeprom.ScreenChannel[gEeprom.RX_CHANNEL] = gRxVfo->CHANNEL_SAVE; gEeprom.ScreenChannel[gEeprom.RX_CHANNEL] = gRxVfo->CHANNEL_SAVE;
gNOAA_Countdown = 500; gNOAA_Countdown_10ms = 500; // 5 sec
gScheduleNOAA = false; gScheduleNOAA = false;
} }
#endif #endif
@ -440,9 +449,14 @@ void APP_StartListening(FUNCTION_Type_t Function)
if (gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF && gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) if (gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF && gEeprom.DUAL_WATCH != DUAL_WATCH_OFF)
{ {
gDualWatchCountdown_10ms = dual_watch_count_after_2_10ms;
gDualWatchCountdownExpired = false;
gRxVfoIsActive = true; gRxVfoIsActive = true;
gDualWatchCountdown = dual_watch_count_after_2_10ms;
gScheduleDualWatch = false; // let the user see DW is not active
gDualWatchActive = false;
gUpdateStatus = true;
} }
if (gRxVfo->IsAM) if (gRxVfo->IsAM)
@ -532,7 +546,7 @@ static void FREQ_NextChannel(void)
RADIO_SetupRegisters(true); RADIO_SetupRegisters(true);
gUpdateDisplay = true; gUpdateDisplay = true;
ScanPauseDelayIn10msec = 10; ScanPauseDelayIn_10ms = 10;
bScanKeepFrequency = false; bScanKeepFrequency = false;
} }
@ -587,7 +601,7 @@ Skip:
gUpdateDisplay = true; gUpdateDisplay = true;
} }
ScanPauseDelayIn10msec = 20; ScanPauseDelayIn_10ms = 20;
bScanKeepFrequency = false; bScanKeepFrequency = false;
@ -629,10 +643,16 @@ static void DUALWATCH_Alternate(void)
RADIO_SetupRegisters(false); RADIO_SetupRegisters(false);
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
gDualWatchCountdown = gIsNoaaMode ? dual_watch_count_noaa_10ms : dual_watch_count_toggle_10ms; gDualWatchCountdown_10ms = gIsNoaaMode ? dual_watch_count_noaa_10ms : dual_watch_count_toggle_10ms;
#else #else
gDualWatchCountdown = dual_watch_count_toggle_10ms; gDualWatchCountdown_10ms = dual_watch_count_toggle_10ms;
#endif #endif
if (!gDualWatchActive)
{ // let the user see DW is active
gDualWatchActive = true;
gUpdateStatus = true;
}
} }
void APP_CheckRadioInterrupts(void) void APP_CheckRadioInterrupts(void)
@ -718,14 +738,18 @@ void APP_CheckRadioInterrupts(void)
{ {
if (gCurrentFunction == FUNCTION_POWER_SAVE && !gRxIdleMode) if (gCurrentFunction == FUNCTION_POWER_SAVE && !gRxIdleMode)
{ {
gBatterySave = 20; gBatterySave_10ms = 20; // 200ms
gBatterySaveCountdownExpired = false; gBatterySaveExpired = false;
} }
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF && (gScheduleDualWatch || gDualWatchCountdown < dual_watch_count_after_vox_10ms)) if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF && (gBatterySaveCountdownExpired || gDualWatchCountdown_10ms < dual_watch_count_after_vox_10ms))
{ {
gDualWatchCountdown = dual_watch_count_after_vox_10ms; gDualWatchCountdown_10ms = dual_watch_count_after_vox_10ms;
gScheduleDualWatch = false; gDualWatchCountdownExpired = false;
// let the user see DW is not active
gDualWatchActive = false;
gUpdateStatus = true;
} }
} }
} }
@ -816,9 +840,9 @@ static void APP_HandleVox(void)
if (gVOX_NoiseDetected) if (gVOX_NoiseDetected)
{ {
if (g_VOX_Lost) if (g_VOX_Lost)
gVoxStopCountdown = 100; gVoxStopCountdown_10ms = 100; // 1 sec
else else
if (gVoxStopCountdown == 0) if (gVoxStopCountdown_10ms == 0)
gVOX_NoiseDetected = false; gVOX_NoiseDetected = false;
if (gCurrentFunction == FUNCTION_TRANSMIT && !gPttIsPressed && !gVOX_NoiseDetected) if (gCurrentFunction == FUNCTION_TRANSMIT && !gPttIsPressed && !gVOX_NoiseDetected)
@ -943,28 +967,30 @@ void APP_Update(void)
NOAA_IncreaseChannel(); NOAA_IncreaseChannel();
RADIO_SetupRegisters(false); RADIO_SetupRegisters(false);
gNOAA_Countdown_10ms = 7; // 70ms
gScheduleNOAA = false; gScheduleNOAA = false;
gNOAA_Countdown = 7;
} }
#endif #endif
// toggle between the VFO's if dual watch is enabled
if (gScreenToDisplay != DISPLAY_SCANNER && gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) if (gScreenToDisplay != DISPLAY_SCANNER && gEeprom.DUAL_WATCH != DUAL_WATCH_OFF)
{ {
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
if (gScheduleDualWatch && gVoiceWriteIndex == 0) if (gDualWatchCountdownExpired && gVoiceWriteIndex == 0)
#else #else
if (gScheduleDualWatch) if (gDualWatchCountdownExpired)
#endif #endif
{ {
if (gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF) if (gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF)
{ {
if (!gPttIsPressed &&
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
if (!gPttIsPressed && !gFmRadioMode && gDTMF_CallState == DTMF_CALL_STATE_NONE && gCurrentFunction != FUNCTION_POWER_SAVE) !gFmRadioMode &&
#else
if (!gPttIsPressed && gDTMF_CallState == DTMF_CALL_STATE_NONE && gCurrentFunction != FUNCTION_POWER_SAVE)
#endif #endif
gDTMF_CallState == DTMF_CALL_STATE_NONE &&
gCurrentFunction != FUNCTION_POWER_SAVE)
{ {
gScheduleDualWatch = false; gDualWatchCountdownExpired = false;
DUALWATCH_Alternate(); // toggle between the two VFO's DUALWATCH_Alternate(); // toggle between the two VFO's
@ -994,7 +1020,7 @@ void APP_Update(void)
if (gEeprom.VOX_SWITCH) if (gEeprom.VOX_SWITCH)
APP_HandleVox(); APP_HandleVox();
if (gSchedulePowerSave) if (gBatterySaveCountdownExpired)
{ {
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
if ( if (
@ -1008,12 +1034,20 @@ void APP_Update(void)
gCssScanMode != CSS_SCAN_MODE_OFF || gCssScanMode != CSS_SCAN_MODE_OFF ||
gScreenToDisplay != DISPLAY_MAIN || gScreenToDisplay != DISPLAY_MAIN ||
gDTMF_CallState != DTMF_CALL_STATE_NONE) gDTMF_CallState != DTMF_CALL_STATE_NONE)
gBatterySaveCountdown = battery_save_count_10ms; {
gBatterySaveCountdown_10ms = battery_save_count_10ms;
gBatterySaveCountdownExpired = false;
}
else else
if ((IS_NOT_NOAA_CHANNEL(gEeprom.ScreenChannel[0]) && IS_NOT_NOAA_CHANNEL(gEeprom.ScreenChannel[1])) || !gIsNoaaMode) if ((IS_NOT_NOAA_CHANNEL(gEeprom.ScreenChannel[0]) && IS_NOT_NOAA_CHANNEL(gEeprom.ScreenChannel[1])) || !gIsNoaaMode)
{
FUNCTION_Select(FUNCTION_POWER_SAVE); FUNCTION_Select(FUNCTION_POWER_SAVE);
}
else else
gBatterySaveCountdown = battery_save_count_10ms; {
gBatterySaveCountdown_10ms = battery_save_count_10ms;
gBatterySaveCountdownExpired = false;
}
#else #else
if ( if (
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
@ -1026,18 +1060,21 @@ void APP_Update(void)
gCssScanMode != CSS_SCAN_MODE_OFF || gCssScanMode != CSS_SCAN_MODE_OFF ||
gScreenToDisplay != DISPLAY_MAIN || gScreenToDisplay != DISPLAY_MAIN ||
gDTMF_CallState != DTMF_CALL_STATE_NONE) gDTMF_CallState != DTMF_CALL_STATE_NONE)
gBatterySaveCountdown = battery_save_count_10ms; {
gBatterySaveCountdown_10ms = battery_save_count_10ms;
gBatterySaveCountdownExpired = false;
}
else else
{
FUNCTION_Select(FUNCTION_POWER_SAVE); FUNCTION_Select(FUNCTION_POWER_SAVE);
}
#endif #endif
gSchedulePowerSave = false;
} }
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
if (gBatterySaveCountdownExpired && gCurrentFunction == FUNCTION_POWER_SAVE && gVoiceWriteIndex == 0) if (gBatterySaveExpired && gCurrentFunction == FUNCTION_POWER_SAVE && gVoiceWriteIndex == 0)
#else #else
if (gBatterySaveCountdownExpired && gCurrentFunction == FUNCTION_POWER_SAVE) if (gBatterySaveExpired && gCurrentFunction == FUNCTION_POWER_SAVE)
#endif #endif
{ {
if (gRxIdleMode) if (gRxIdleMode)
@ -1050,12 +1087,15 @@ void APP_Update(void)
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF && gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF) if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF && gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF)
{ {
DUALWATCH_Alternate(); // toggle between the two VFO's DUALWATCH_Alternate(); // toggle between the two VFO's
gUpdateRSSI = false; gUpdateRSSI = false;
} }
FUNCTION_Init(); FUNCTION_Init();
gBatterySave = 10; gBatterySave_10ms = 10; // 100ms
gBatterySaveExpired = false;
gRxIdleMode = false; gRxIdleMode = false;
} }
else else
@ -1064,7 +1104,9 @@ void APP_Update(void)
gCurrentRSSI = BK4819_GetRSSI(); gCurrentRSSI = BK4819_GetRSSI();
UI_UpdateRSSI(gCurrentRSSI); UI_UpdateRSSI(gCurrentRSSI);
gBatterySave = gEeprom.BATTERY_SAVE * 10; gBatterySave_10ms = gEeprom.BATTERY_SAVE * 10;
gBatterySaveExpired = false;
gRxIdleMode = true; gRxIdleMode = true;
BK4819_DisableVox(); BK4819_DisableVox();
@ -1079,10 +1121,10 @@ void APP_Update(void)
DUALWATCH_Alternate(); // toggle between the two VFO's DUALWATCH_Alternate(); // toggle between the two VFO's
gUpdateRSSI = true; gUpdateRSSI = true;
gBatterySave = 10;
}
gBatterySaveCountdownExpired = false; gBatterySave_10ms = 10; // 100ms
gBatterySaveExpired = false;
}
} }
} }
@ -1144,6 +1186,7 @@ void APP_CheckKeys(void)
{ // PTT pressed { // PTT pressed
if (++gPttDebounceCounter >= 3) // 30ms if (++gPttDebounceCounter >= 3) // 30ms
{ // start transmitting { // start transmitting
boot_counter_10ms = 0;
gPttDebounceCounter = 0; gPttDebounceCounter = 0;
gPttIsPressed = true; gPttIsPressed = true;
APP_ProcessKey(KEY_PTT, true, false); APP_ProcessKey(KEY_PTT, true, false);
@ -1157,6 +1200,9 @@ void APP_CheckKeys(void)
// scan the hardware keys // scan the hardware keys
Key = KEYBOARD_Poll(); Key = KEYBOARD_Poll();
if (Key != KEY_INVALID)
boot_counter_10ms = 0;
if (gKeyReading0 != Key) if (gKeyReading0 != Key)
{ // new key pressed { // new key pressed
@ -1233,8 +1279,8 @@ void APP_TimeSlice10ms(void)
gFlashLightBlinkCounter++; gFlashLightBlinkCounter++;
#ifdef ENABLE_BOOT_BEEPS #ifdef ENABLE_BOOT_BEEPS
if (boot_counter < 255) if (boot_counter_10ms > 0)
if ((boot_counter % 25) == 0) if ((boot_counter_10ms % 25) == 0)
AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL); AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL);
#endif #endif
@ -1783,7 +1829,7 @@ void CHANNEL_Next(bool bFlag, int8_t Direction)
FREQ_NextChannel(); FREQ_NextChannel();
} }
ScanPauseDelayIn10msec = 50; // 500ms ScanPauseDelayIn_10ms = 50; // 500ms
gScheduleScanListen = false; gScheduleScanListen = false;
gRxReceptionMode = RX_MODE_NONE; gRxReceptionMode = RX_MODE_NONE;
gScanPauseMode = false; gScanPauseMode = false;
@ -1797,7 +1843,7 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
if (gCurrentFunction == FUNCTION_POWER_SAVE) if (gCurrentFunction == FUNCTION_POWER_SAVE)
FUNCTION_Select(FUNCTION_FOREGROUND); FUNCTION_Select(FUNCTION_FOREGROUND);
gBatterySaveCountdown = battery_save_count_10ms; gBatterySaveCountdown_10ms = battery_save_count_10ms;
if (gEeprom.AUTO_KEYPAD_LOCK) if (gEeprom.AUTO_KEYPAD_LOCK)
gKeyLockCountdown = 30; // 15 seconds gKeyLockCountdown = 30; // 15 seconds

View File

@ -131,7 +131,7 @@ void MENU_StartCssScan(int8_t Direction)
MENU_SelectNextCode(); MENU_SelectNextCode();
ScanPauseDelayIn10msec = 50; ScanPauseDelayIn_10ms = 50;
gScheduleScanListen = false; gScheduleScanListen = false;
} }
@ -746,7 +746,7 @@ void MENU_SelectNextCode(void)
RADIO_SetupRegisters(true); RADIO_SetupRegisters(true);
ScanPauseDelayIn10msec = (gSelectedCodeType == CODE_TYPE_CONTINUOUS_TONE) ? 20 : 30; ScanPauseDelayIn_10ms = (gSelectedCodeType == CODE_TYPE_CONTINUOUS_TONE) ? 20 : 30;
gUpdateDisplay = true; gUpdateDisplay = true;
} }

View File

@ -36,7 +36,7 @@ uint32_t gScanFrequency;
bool gScanPauseMode; bool gScanPauseMode;
SCAN_CssState_t gScanCssState; SCAN_CssState_t gScanCssState;
volatile bool gScheduleScanListen = true; volatile bool gScheduleScanListen = true;
volatile uint16_t ScanPauseDelayIn10msec; volatile uint16_t ScanPauseDelayIn_10ms;
uint8_t gScanProgressIndicator; uint8_t gScanProgressIndicator;
uint8_t gScanHitCount; uint8_t gScanHitCount;
bool gScanUseCssResult; bool gScanUseCssResult;

View File

@ -46,7 +46,7 @@ extern uint32_t gScanFrequency;
extern bool gScanPauseMode; extern bool gScanPauseMode;
extern SCAN_CssState_t gScanCssState; extern SCAN_CssState_t gScanCssState;
extern volatile bool gScheduleScanListen; extern volatile bool gScheduleScanListen;
extern volatile uint16_t ScanPauseDelayIn10msec; extern volatile uint16_t ScanPauseDelayIn_10ms;
extern uint8_t gScanProgressIndicator; extern uint8_t gScanProgressIndicator;
extern uint8_t gScanHitCount; extern uint8_t gScanHitCount;
extern bool gScanUseCssResult; extern bool gScanUseCssResult;

View File

@ -62,7 +62,7 @@
VOICE_ID_t gVoiceID[8]; VOICE_ID_t gVoiceID[8];
uint8_t gVoiceReadIndex; uint8_t gVoiceReadIndex;
uint8_t gVoiceWriteIndex; uint8_t gVoiceWriteIndex;
volatile uint16_t gCountdownToPlayNextVoice; volatile uint16_t gCountdownToPlayNextVoice_10ms;
volatile bool gFlagPlayQueuedVoice; volatile bool gFlagPlayQueuedVoice;
VOICE_ID_t gAnotherVoiceID = VOICE_ID_INVALID; VOICE_ID_t gAnotherVoiceID = VOICE_ID_INVALID;
@ -284,7 +284,7 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
} }
gVoiceReadIndex = 1; gVoiceReadIndex = 1;
gCountdownToPlayNextVoice = Delay; gCountdownToPlayNextVoice_10ms = Delay;
gFlagPlayQueuedVoice = false; gFlagPlayQueuedVoice = false;
return; return;
@ -390,7 +390,7 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
AUDIO_PlayVoice(VoiceID); AUDIO_PlayVoice(VoiceID);
gCountdownToPlayNextVoice = Delay; gCountdownToPlayNextVoice_10ms = Delay;
gFlagPlayQueuedVoice = false; gFlagPlayQueuedVoice = false;
gVoxResumeCountdown = 2000; gVoxResumeCountdown = 2000;

View File

@ -132,7 +132,7 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep);
extern VOICE_ID_t gVoiceID[8]; extern VOICE_ID_t gVoiceID[8];
extern uint8_t gVoiceReadIndex; extern uint8_t gVoiceReadIndex;
extern uint8_t gVoiceWriteIndex; extern uint8_t gVoiceWriteIndex;
extern volatile uint16_t gCountdownToPlayNextVoice; extern volatile uint16_t gCountdownToPlayNextVoice_10ms;
extern volatile bool gFlagPlayQueuedVoice; extern volatile bool gFlagPlayQueuedVoice;
extern VOICE_ID_t gAnotherVoiceID; extern VOICE_ID_t gAnotherVoiceID;

View File

@ -227,7 +227,7 @@ const uint8_t BITMAP_VOX[] =
}; };
#endif #endif
const uint8_t BITMAP_TDR[] = const uint8_t BITMAP_TDR1[] =
{ // "DW" { // "DW"
0b00000000, 0b00000000,
0b01111111, 0b01111111,
@ -244,6 +244,23 @@ const uint8_t BITMAP_TDR[] =
0b01111111 0b01111111
}; };
const uint8_t BITMAP_TDR2[] =
{ // "--"
0b00000000,
0b00010000,
0b00010000,
0b00010000,
0b00010000,
0b00010000,
0b00010000,
0b00010000,
0b00010000,
0b00010000,
0b00010000,
0b00010000,
};
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
const uint8_t BITMAP_VoicePrompt[] = const uint8_t BITMAP_VoicePrompt[] =
{ {

View File

@ -26,7 +26,8 @@ extern const uint8_t BITMAP_VOX[18];
extern const uint8_t BITMAP_XB[12]; extern const uint8_t BITMAP_XB[12];
#endif #endif
extern const uint8_t BITMAP_TDR[12]; extern const uint8_t BITMAP_TDR1[12];
extern const uint8_t BITMAP_TDR2[12];
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
extern const uint8_t BITMAP_VoicePrompt[9]; extern const uint8_t BITMAP_VoicePrompt[9];

BIN
firmware

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -70,16 +70,18 @@ void FUNCTION_Init(void)
g_VOX_Lost = false; g_VOX_Lost = false;
g_SquelchLost = false; g_SquelchLost = false;
gFlagTteComplete = false;
gTailNoteEliminationCountdown = 0; gFlagTailNoteEliminationComplete = false;
gTailNoteEliminationCountdown_10ms = 0;
gFoundCTCSS = false; gFoundCTCSS = false;
gFoundCDCSS = false; gFoundCDCSS = false;
gFoundCTCSSCountdown = 0; gFoundCTCSSCountdown_10ms = 0;
gFoundCDCSSCountdown = 0; gFoundCDCSSCountdown_10ms = 0;
gEndOfRxDetectedMaybe = false; gEndOfRxDetectedMaybe = false;
gSystickCountdown2 = 0; #ifdef ENABLE_NOAA
gNOAACountdown_10ms = 0;
#endif
} }
void FUNCTION_Select(FUNCTION_Type_t Function) void FUNCTION_Select(FUNCTION_Type_t Function)
@ -132,14 +134,15 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
break; break;
case FUNCTION_POWER_SAVE: case FUNCTION_POWER_SAVE:
gBatterySave = gEeprom.BATTERY_SAVE * 10; gBatterySave_10ms = gEeprom.BATTERY_SAVE * 10;
gBatterySaveExpired = false;
gRxIdleMode = true; gRxIdleMode = true;
BK4819_DisableVox(); BK4819_DisableVox();
BK4819_Sleep(); BK4819_Sleep();
BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2, false); BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2, false);
gBatterySaveCountdownExpired = false;
gUpdateStatus = true; gUpdateStatus = true;
GUI_SelectNextDisplay(DISPLAY_MAIN); GUI_SelectNextDisplay(DISPLAY_MAIN);
@ -195,8 +198,9 @@ void FUNCTION_Select(FUNCTION_Type_t Function)
break; break;
} }
gBatterySaveCountdown = battery_save_count_10ms; gBatterySaveCountdown_10ms = battery_save_count_10ms;
gSchedulePowerSave = false; gBatterySaveCountdownExpired = false;
#if defined(ENABLE_FMRADIO) #if defined(ENABLE_FMRADIO)
gFM_RestoreCountdown = 0; gFM_RestoreCountdown = 0;
#endif #endif

View File

@ -31,7 +31,9 @@ bool gChargingWithTypeC;
bool gLowBattery; bool gLowBattery;
bool gLowBatteryBlink; bool gLowBatteryBlink;
uint16_t gBatteryCheckCounter; uint16_t gBatteryCheckCounter;
volatile uint16_t gBatterySave;
volatile uint16_t gBatterySave_10ms;
volatile bool gBatterySaveExpired;
void BATTERY_GetReadings(bool bDisplayBatteryLevel) void BATTERY_GetReadings(bool bDisplayBatteryLevel)
{ {

View File

@ -30,7 +30,9 @@ extern bool gChargingWithTypeC;
extern bool gLowBattery; extern bool gLowBattery;
extern bool gLowBatteryBlink; extern bool gLowBatteryBlink;
extern uint16_t gBatteryCheckCounter; extern uint16_t gBatteryCheckCounter;
extern volatile uint16_t gBatterySave;
extern volatile uint16_t gBatterySave_10ms;
extern volatile bool gBatterySaveExpired;
void BATTERY_GetReadings(bool bDisplayBatteryLevel); void BATTERY_GetReadings(bool bDisplayBatteryLevel);

15
main.c
View File

@ -16,7 +16,6 @@
#include <string.h> #include <string.h>
#include "scheduler.h"
#include "app/app.h" #include "app/app.h"
#include "app/dtmf.h" #include "app/dtmf.h"
#include "audio.h" #include "audio.h"
@ -98,6 +97,10 @@ void Main(void)
gMenuListCount = 0; gMenuListCount = 0;
#ifdef ENABLE_BOOT_BEEPS
boot_counter_10ms = 250; // 2.5 sec
#endif
if (!gChargingWithTypeC && !gBatteryDisplayLevel) if (!gChargingWithTypeC && !gBatteryDisplayLevel)
{ {
FUNCTION_Select(FUNCTION_POWER_SAVE); FUNCTION_Select(FUNCTION_POWER_SAVE);
@ -124,14 +127,18 @@ void Main(void)
if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE) if (gEeprom.POWER_ON_DISPLAY_MODE != POWER_ON_DISPLAY_MODE_NONE)
{ // 2.55 second boot-up screen { // 2.55 second boot-up screen
while (boot_counter < 255 && KEYBOARD_Poll() == KEY_INVALID) while (boot_counter_10ms > 0)
{ {
if (KEYBOARD_Poll() != KEY_INVALID)
{ // halt boot beeps
boot_counter_10ms = 0;
break;
}
#ifdef ENABLE_BOOT_BEEPS #ifdef ENABLE_BOOT_BEEPS
if ((boot_counter % 25) == 0) if ((boot_counter_10ms % 25) == 0)
AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL); AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL);
#endif #endif
} }
//boot_counter = 255; // halt boot beeps
} }
BootMode = BOOT_GetMode(); BootMode = BOOT_GetMode();

32
misc.c
View File

@ -43,9 +43,9 @@ const uint16_t dual_watch_count_after_tx_10ms = 3600 / 10; // 3.6 sec af
const uint16_t dual_watch_count_after_rx_10ms = 1000 / 10; // 1 sec after RX ends ? const uint16_t dual_watch_count_after_rx_10ms = 1000 / 10; // 1 sec after RX ends ?
const uint16_t dual_watch_count_after_1_10ms = 5000 / 10; // 5 sec 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_after_2_10ms = 3600 / 10; // 3.6 sec
const uint16_t dual_watch_count_toggle_10ms = 100 / 10; // 100ms between VFO toggles
const uint16_t dual_watch_count_noaa_10ms = 70 / 10; // 70ms const uint16_t dual_watch_count_noaa_10ms = 70 / 10; // 70ms
const uint16_t dual_watch_count_after_vox_10ms = 200 / 10; // 200ms const uint16_t dual_watch_count_after_vox_10ms = 200 / 10; // 200ms
const uint16_t dual_watch_count_toggle_10ms = 100 / 10; // 100ms between VFO toggles
const uint16_t battery_save_count_10ms = 10000 / 10; // 10 seconds const uint16_t battery_save_count_10ms = 10000 / 10; // 10 seconds
@ -81,13 +81,18 @@ uint16_t gEEPROM_1F8C;
uint8_t gMR_ChannelAttributes[207]; uint8_t gMR_ChannelAttributes[207];
volatile uint16_t gBatterySaveCountdown_10ms = battery_save_count_10ms;
volatile bool gBatterySaveCountdownExpired;
volatile uint16_t gDualWatchCountdown_10ms;
volatile bool gDualWatchCountdownExpired = true;
bool gDualWatchActive = false;
volatile bool gNextTimeslice500ms; volatile bool gNextTimeslice500ms;
volatile uint16_t gBatterySaveCountdown = battery_save_count_10ms;
volatile uint16_t gDualWatchCountdown;
volatile uint16_t gTxTimerCountdown; volatile uint16_t gTxTimerCountdown;
volatile uint16_t gTailNoteEliminationCountdown; volatile uint16_t gTailNoteEliminationCountdown_10ms;
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
volatile uint16_t gNOAA_Countdown; volatile uint16_t gNOAA_Countdown_10ms;
#endif #endif
bool gEnableSpeaker; bool gEnableSpeaker;
@ -179,23 +184,24 @@ bool gF_LOCK;
uint8_t gShowChPrefix; uint8_t gShowChPrefix;
volatile bool gNextTimeslice; volatile bool gNextTimeslice;
volatile uint16_t gSystickCountdown2; volatile uint8_t gFoundCDCSSCountdown_10ms;
volatile uint8_t gFoundCDCSSCountdown; volatile uint8_t gFoundCTCSSCountdown_10ms;
volatile uint8_t gFoundCTCSSCountdown; volatile uint16_t gVoxStopCountdown_10ms;
volatile uint16_t gVoxStopCountdown;
volatile bool gTxTimeoutReached; volatile bool gTxTimeoutReached;
volatile bool gNextTimeslice40ms; volatile bool gNextTimeslice40ms;
volatile bool gSchedulePowerSave;
volatile bool gBatterySaveCountdownExpired;
volatile bool gScheduleDualWatch = true;
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
volatile uint16_t gNOAACountdown_10ms = 0;
volatile bool gScheduleNOAA = true; volatile bool gScheduleNOAA = true;
#endif #endif
volatile bool gFlagTteComplete; volatile bool gFlagTailNoteEliminationComplete;
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
volatile bool gScheduleFM; volatile bool gScheduleFM;
#endif #endif
#ifdef ENABLE_BOOT_BEEPS
volatile uint8_t boot_counter_10ms;
#endif
uint16_t gCurrentRSSI; uint16_t gCurrentRSSI;
uint8_t gIsLocked = 0xFF; uint8_t gIsLocked = 0xFF;

29
misc.h
View File

@ -139,16 +139,21 @@ extern uint16_t gEEPROM_1F8C;
extern uint8_t gMR_ChannelAttributes[207]; extern uint8_t gMR_ChannelAttributes[207];
extern volatile uint16_t gBatterySaveCountdown_10ms;
extern volatile bool gBatterySaveCountdownExpired;
extern volatile uint16_t gDualWatchCountdown_10ms;
extern volatile bool gDualWatchCountdownExpired;
extern bool gDualWatchActive;
extern volatile bool gNextTimeslice500ms; extern volatile bool gNextTimeslice500ms;
extern volatile uint16_t gBatterySaveCountdown;
extern volatile uint16_t gDualWatchCountdown;
extern volatile uint16_t gTxTimerCountdown; extern volatile uint16_t gTxTimerCountdown;
extern volatile uint16_t gTailNoteEliminationCountdown; extern volatile uint16_t gTailNoteEliminationCountdown_10ms;
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
extern volatile uint16_t gFmPlayCountdown_10ms; extern volatile uint16_t gFmPlayCountdown_10ms;
#endif #endif
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
extern volatile uint16_t gNOAA_Countdown; extern volatile uint16_t gNOAA_Countdown_10ms;
#endif #endif
extern bool gEnableSpeaker; extern bool gEnableSpeaker;
extern uint8_t gKeyInputCountdown; extern uint8_t gKeyInputCountdown;
@ -235,24 +240,24 @@ extern bool gUpdateDisplay;
#endif #endif
extern bool gF_LOCK; extern bool gF_LOCK;
extern uint8_t gShowChPrefix; extern uint8_t gShowChPrefix;
extern volatile uint16_t gSystickCountdown2; extern volatile uint8_t gFoundCDCSSCountdown_10ms;
extern volatile uint8_t gFoundCDCSSCountdown; extern volatile uint8_t gFoundCTCSSCountdown_10ms;
extern volatile uint8_t gFoundCTCSSCountdown; extern volatile uint16_t gVoxStopCountdown_10ms;
extern volatile uint16_t gVoxStopCountdown;
extern volatile bool gTxTimeoutReached; extern volatile bool gTxTimeoutReached;
extern volatile bool gNextTimeslice40ms; extern volatile bool gNextTimeslice40ms;
extern volatile bool gSchedulePowerSave;
extern volatile bool gBatterySaveCountdownExpired;
extern volatile bool gScheduleDualWatch;
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
extern volatile uint16_t gNOAACountdown_10ms;
extern volatile bool gScheduleNOAA; extern volatile bool gScheduleNOAA;
#endif #endif
extern volatile bool gFlagTteComplete; extern volatile bool gFlagTailNoteEliminationComplete;
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
extern volatile bool gScheduleFM; extern volatile bool gScheduleFM;
#endif #endif
extern uint16_t gCurrentRSSI; extern uint16_t gCurrentRSSI;
extern uint8_t gIsLocked; extern uint8_t gIsLocked;
#ifdef ENABLE_BOOT_BEEPS
extern volatile uint8_t boot_counter_10ms;
#endif
void NUMBER_Get(char *pDigits, uint32_t *pInteger); void NUMBER_Get(char *pDigits, uint32_t *pInteger);
void NUMBER_ToDigits(uint32_t Value, char *pDigits); void NUMBER_ToDigits(uint32_t Value, char *pDigits);

12
radio.c
View File

@ -769,7 +769,7 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
{ {
gIsNoaaMode = true; gIsNoaaMode = true;
gNoaaChannel = gRxVfo->CHANNEL_SAVE - NOAA_CHANNEL_FIRST; gNoaaChannel = gRxVfo->CHANNEL_SAVE - NOAA_CHANNEL_FIRST;
gNOAA_Countdown = 50; gNOAA_Countdown_10ms = 50; // 500ms
gScheduleNOAA = false; gScheduleNOAA = false;
} }
else else
@ -877,17 +877,21 @@ void RADIO_PrepareTX(void)
{ {
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF)
{ {
gDualWatchCountdown = dual_watch_count_after_tx_10ms; gDualWatchCountdown_10ms = dual_watch_count_after_tx_10ms;
gScheduleDualWatch = false; gDualWatchCountdownExpired = false;
if (!gRxVfoIsActive) if (!gRxVfoIsActive)
{ {
gEeprom.RX_CHANNEL = gEeprom.TX_CHANNEL; gEeprom.RX_CHANNEL = gEeprom.TX_CHANNEL;
gRxVfo = &gEeprom.VfoInfo[gEeprom.TX_CHANNEL]; gRxVfo = &gEeprom.VfoInfo[gEeprom.TX_CHANNEL];
}
gRxVfoIsActive = true; gRxVfoIsActive = true;
} }
// let the user see that DW is not active
gDualWatchActive = false;
gUpdateStatus = true;
}
RADIO_SelectCurrentVfo(); RADIO_SelectCurrentVfo();
#ifdef ENABLE_ALARM #ifdef ENABLE_ALARM

View File

@ -14,7 +14,6 @@
* limitations under the License. * limitations under the License.
*/ */
#include "scheduler.h"
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
#include "app/fm.h" #include "app/fm.h"
#endif #endif
@ -29,17 +28,20 @@
#include "bsp/dp32g030/gpio.h" #include "bsp/dp32g030/gpio.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#define DECREMENT(cnt) \
do { \
if (cnt > 0) \
cnt--; \
} while (0)
#define DECREMENT_AND_TRIGGER(cnt, flag) \ #define DECREMENT_AND_TRIGGER(cnt, flag) \
do { \ do { \
if (cnt) { \ if (cnt > 0) \
if (--cnt == 0) { \ if (--cnt == 0) \
flag = true; \ flag = true; \
} \ } while (0)
} \
} while(0)
static volatile uint32_t gGlobalSysTickCounter; static volatile uint32_t gGlobalSysTickCounter;
volatile uint8_t boot_counter = 0;
void SystickHandler(void); void SystickHandler(void);
@ -59,40 +61,39 @@ void SystickHandler(void)
if ((gGlobalSysTickCounter & 3) == 0) if ((gGlobalSysTickCounter & 3) == 0)
gNextTimeslice40ms = true; gNextTimeslice40ms = true;
if (gSystickCountdown2) #ifdef ENABLE_NOAA
gSystickCountdown2--; DECREMENT(gNOAACountdown_10ms);
#endif
if (gFoundCDCSSCountdown) DECREMENT(gFoundCDCSSCountdown_10ms);
gFoundCDCSSCountdown--;
if (gFoundCTCSSCountdown) DECREMENT(gFoundCTCSSCountdown_10ms);
gFoundCTCSSCountdown--;
if (gCurrentFunction == FUNCTION_FOREGROUND) if (gCurrentFunction == FUNCTION_FOREGROUND)
DECREMENT_AND_TRIGGER(gBatterySaveCountdown, gSchedulePowerSave); DECREMENT_AND_TRIGGER(gBatterySaveCountdown_10ms, gBatterySaveCountdownExpired);
if (gCurrentFunction == FUNCTION_POWER_SAVE) if (gCurrentFunction == FUNCTION_POWER_SAVE)
DECREMENT_AND_TRIGGER(gBatterySave, gBatterySaveCountdownExpired); DECREMENT_AND_TRIGGER(gBatterySave_10ms, gBatterySaveExpired);
if (gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF && gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) if (gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF && gEeprom.DUAL_WATCH != DUAL_WATCH_OFF)
if (gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT && gCurrentFunction != FUNCTION_RECEIVE) if (gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT && gCurrentFunction != FUNCTION_RECEIVE)
DECREMENT_AND_TRIGGER(gDualWatchCountdown, gScheduleDualWatch); DECREMENT_AND_TRIGGER(gDualWatchCountdown_10ms, gDualWatchCountdownExpired);
#ifdef ENABLE_NOAA #ifdef ENABLE_NOAA
if (gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF && gEeprom.DUAL_WATCH == DUAL_WATCH_OFF) if (gScanState == SCAN_OFF && gCssScanMode == CSS_SCAN_MODE_OFF && gEeprom.DUAL_WATCH == DUAL_WATCH_OFF)
if (gIsNoaaMode && gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT) if (gIsNoaaMode && gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT)
if (gCurrentFunction != FUNCTION_RECEIVE) if (gCurrentFunction != FUNCTION_RECEIVE)
DECREMENT_AND_TRIGGER(gNOAA_Countdown, gScheduleNOAA); DECREMENT_AND_TRIGGER(gNOAA_Countdown_10ms, gScheduleNOAA);
#endif #endif
if (gScanState != SCAN_OFF || gCssScanMode == CSS_SCAN_MODE_SCANNING) if (gScanState != SCAN_OFF || gCssScanMode == CSS_SCAN_MODE_SCANNING)
if (gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT) if (gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT)
DECREMENT_AND_TRIGGER(ScanPauseDelayIn10msec, gScheduleScanListen); DECREMENT_AND_TRIGGER(ScanPauseDelayIn_10ms, gScheduleScanListen);
DECREMENT_AND_TRIGGER(gTailNoteEliminationCountdown, gFlagTteComplete); DECREMENT_AND_TRIGGER(gTailNoteEliminationCountdown_10ms, gFlagTailNoteEliminationComplete);
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
DECREMENT_AND_TRIGGER(gCountdownToPlayNextVoice, gFlagPlayQueuedVoice); DECREMENT_AND_TRIGGER(gCountdownToPlayNextVoice_10ms, gFlagPlayQueuedVoice);
#endif #endif
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
@ -101,9 +102,9 @@ void SystickHandler(void)
DECREMENT_AND_TRIGGER(gFmPlayCountdown_10ms, gScheduleFM); DECREMENT_AND_TRIGGER(gFmPlayCountdown_10ms, gScheduleFM);
#endif #endif
if (gVoxStopCountdown) DECREMENT(gVoxStopCountdown_10ms);
gVoxStopCountdown--;
if (boot_counter < 255) #ifdef ENABLE_BOOT_BEEPS
boot_counter++; DECREMENT(boot_counter_10ms);
#endif
} }

View File

@ -1,25 +0,0 @@
/* Copyright 2023 Dual Tachyon
* https://github.com/DualTachyon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef SCHEDULER_H
#define SCHEDULER_H
#include <stdint.h>
extern volatile uint8_t boot_counter;
#endif

View File

@ -76,7 +76,7 @@ void UI_DisplayMain(void)
} }
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF && gRxVfoIsActive) if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF && gRxVfoIsActive)
Channel = gEeprom.RX_CHANNEL; Channel = gEeprom.RX_CHANNEL; // we're currently monitoring the other VFO
if (Channel != vfo_num) if (Channel != vfo_num)
{ {

View File

@ -55,7 +55,12 @@ void UI_DisplayStatus(const bool test_display)
#endif #endif
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF || test_display) if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF || test_display)
memmove(gStatusLine + 45, BITMAP_TDR, sizeof(BITMAP_TDR)); {
if (gDualWatchActive)
memmove(gStatusLine + 45, BITMAP_TDR1, sizeof(BITMAP_TDR1));
else
memmove(gStatusLine + 45, BITMAP_TDR2, sizeof(BITMAP_TDR2));
}
if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF || test_display) if (gEeprom.CROSS_BAND_RX_TX != CROSS_BAND_OFF || test_display)
memmove(gStatusLine + 58, BITMAP_XB, sizeof(BITMAP_XB)); memmove(gStatusLine + 58, BITMAP_XB, sizeof(BITMAP_XB));