Ability to disable NOAA.

This commit is contained in:
Dual Tachyon 2023-09-14 11:30:08 +01:00
parent 313a67a482
commit f5cc006b2a
20 changed files with 163 additions and 63 deletions

View File

@ -2,6 +2,7 @@ TARGET = firmware
ENABLE_AIRCOPY := 1 ENABLE_AIRCOPY := 1
ENABLE_FMRADIO := 1 ENABLE_FMRADIO := 1
ENABLE_NOAA := 1
ENABLE_OVERLAY := 1 ENABLE_OVERLAY := 1
ENABLE_UART := 1 ENABLE_UART := 1
@ -124,6 +125,9 @@ endif
ifeq ($(ENABLE_FMRADIO),1) ifeq ($(ENABLE_FMRADIO),1)
CFLAGS += -DENABLE_FMRADIO CFLAGS += -DENABLE_FMRADIO
endif endif
ifeq ($(ENABLE_NOAA),1)
CFLAGS += -DENABLE_NOAA
endif
ifeq ($(ENABLE_OVERLAY),1) ifeq ($(ENABLE_OVERLAY),1)
CFLAGS += -DENABLE_OVERLAY CFLAGS += -DENABLE_OVERLAY
endif endif

View File

@ -63,9 +63,11 @@ static void ACTION_Monitor(void)
{ {
if (gCurrentFunction != FUNCTION_MONITOR) { if (gCurrentFunction != FUNCTION_MONITOR) {
RADIO_SelectVfos(); RADIO_SelectVfos();
#if defined(ENABLE_NOAA)
if (gRxVfo->CHANNEL_SAVE >= NOAA_CHANNEL_FIRST && gIsNoaaMode) { if (gRxVfo->CHANNEL_SAVE >= NOAA_CHANNEL_FIRST && gIsNoaaMode) {
gNoaaChannel = gRxVfo->CHANNEL_SAVE - NOAA_CHANNEL_FIRST; gNoaaChannel = gRxVfo->CHANNEL_SAVE - NOAA_CHANNEL_FIRST;
} }
#endif
RADIO_SetupRegisters(true); RADIO_SetupRegisters(true);
APP_StartListening(FUNCTION_MONITOR); APP_StartListening(FUNCTION_MONITOR);
return; return;
@ -75,10 +77,12 @@ static void ACTION_Monitor(void)
gScheduleScanListen = false; gScheduleScanListen = false;
gScanPauseMode = true; gScanPauseMode = true;
} }
#if defined(ENABLE_NOAA)
if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gIsNoaaMode) { if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gIsNoaaMode) {
gNOAA_Countdown = 500; gNOAA_Countdown = 500;
gScheduleNOAA = false; gScheduleNOAA = false;
} }
#endif
RADIO_SetupRegisters(true); RADIO_SetupRegisters(true);
#if defined(ENABLE_FMRADIO) #if defined(ENABLE_FMRADIO)
if (gFmRadioMode) { if (gFmRadioMode) {

View File

@ -76,10 +76,12 @@ static void APP_CheckForIncoming(void)
gRxReceptionMode = RX_MODE_DETECTED; gRxReceptionMode = RX_MODE_DETECTED;
} }
if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF) { if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF) {
#if defined(ENABLE_NOAA)
if (gIsNoaaMode) { if (gIsNoaaMode) {
gNOAA_Countdown = 20; gNOAA_Countdown = 20;
gScheduleNOAA = false; gScheduleNOAA = false;
} }
#endif
FUNCTION_Select(FUNCTION_INCOMING); FUNCTION_Select(FUNCTION_INCOMING);
return; return;
} }
@ -112,10 +114,12 @@ static void APP_HandleIncoming(void)
} }
bFlag = (gScanState == SCAN_OFF && gCurrentCodeType == CODE_TYPE_OFF); bFlag = (gScanState == SCAN_OFF && gCurrentCodeType == CODE_TYPE_OFF);
#if defined(ENABLE_NOAA)
if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE) && gSystickCountdown2) { if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE) && gSystickCountdown2) {
bFlag = true; bFlag = true;
gSystickCountdown2 = 0; gSystickCountdown2 = 0;
} }
#endif
if (g_CTCSS_Lost && gCurrentCodeType == CODE_TYPE_CONTINUOUS_TONE) { if (g_CTCSS_Lost && gCurrentCodeType == CODE_TYPE_CONTINUOUS_TONE) {
bFlag = true; bFlag = true;
gFoundCTCSS = false; gFoundCTCSS = false;
@ -245,9 +249,11 @@ Skip:
switch (Mode) { switch (Mode) {
case END_OF_RX_MODE_END: case END_OF_RX_MODE_END:
RADIO_SetupRegisters(true); RADIO_SetupRegisters(true);
#if defined(ENABLE_NOAA)
if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE)) { if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE)) {
gSystickCountdown2 = 300; gSystickCountdown2 = 300;
} }
#endif
gUpdateDisplay = true; gUpdateDisplay = true;
if (gScanState != SCAN_OFF) { if (gScanState != SCAN_OFF) {
switch (gEeprom.SCAN_RESUME_MODE) { switch (gEeprom.SCAN_RESUME_MODE) {
@ -324,6 +330,7 @@ void APP_StartListening(FUNCTION_Type_t Function)
} }
bScanKeepFrequency = true; bScanKeepFrequency = true;
} }
#if defined(ENABLE_NOAA)
if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE) && gIsNoaaMode) { if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE) && gIsNoaaMode) {
gRxVfo->CHANNEL_SAVE = gNoaaChannel + NOAA_CHANNEL_FIRST; gRxVfo->CHANNEL_SAVE = gNoaaChannel + NOAA_CHANNEL_FIRST;
gRxVfo->pRX->Frequency = NoaaFrequencyTable[gNoaaChannel]; gRxVfo->pRX->Frequency = NoaaFrequencyTable[gNoaaChannel];
@ -332,6 +339,7 @@ void APP_StartListening(FUNCTION_Type_t Function)
gNOAA_Countdown = 500; gNOAA_Countdown = 500;
gScheduleNOAA = false; gScheduleNOAA = false;
} }
#endif
if (gCssScanMode != CSS_SCAN_MODE_OFF) { if (gCssScanMode != CSS_SCAN_MODE_OFF) {
gCssScanMode = CSS_SCAN_MODE_FOUND; gCssScanMode = CSS_SCAN_MODE_FOUND;
} }
@ -451,6 +459,7 @@ Skip:
} }
} }
#if defined(ENABLE_NOAA)
static void NOAA_NextChannel(void) static void NOAA_NextChannel(void)
{ {
gNoaaChannel++; gNoaaChannel++;
@ -458,9 +467,11 @@ static void NOAA_NextChannel(void)
gNoaaChannel = 0; gNoaaChannel = 0;
} }
} }
#endif
static void DUALWATCH_Alternate(void) static void DUALWATCH_Alternate(void)
{ {
#if defined(ENABLE_NOAA)
if (gIsNoaaMode) { if (gIsNoaaMode) {
if (IS_NOT_NOAA_CHANNEL(gEeprom.ScreenChannel[0]) || IS_NOT_NOAA_CHANNEL(gEeprom.ScreenChannel[1])) { if (IS_NOT_NOAA_CHANNEL(gEeprom.ScreenChannel[0]) || IS_NOT_NOAA_CHANNEL(gEeprom.ScreenChannel[1])) {
gEeprom.RX_CHANNEL = gEeprom.RX_CHANNEL == 0; gEeprom.RX_CHANNEL = gEeprom.RX_CHANNEL == 0;
@ -472,15 +483,19 @@ static void DUALWATCH_Alternate(void)
NOAA_NextChannel(); NOAA_NextChannel();
} }
} else { } else {
#endif
gEeprom.RX_CHANNEL = gEeprom.RX_CHANNEL == 0; gEeprom.RX_CHANNEL = gEeprom.RX_CHANNEL == 0;
gRxVfo = &gEeprom.VfoInfo[gEeprom.RX_CHANNEL]; gRxVfo = &gEeprom.VfoInfo[gEeprom.RX_CHANNEL];
#if defined(ENABLE_NOAA)
} }
#endif
RADIO_SetupRegisters(false); RADIO_SetupRegisters(false);
#if defined(ENABLE_NOAA)
if (gIsNoaaMode) { if (gIsNoaaMode) {
gDualWatchCountdown = 7; gDualWatchCountdown = 7;
} else { } else
#endif
gDualWatchCountdown = 10; gDualWatchCountdown = 10;
}
} }
void APP_CheckRadioInterrupts(void) void APP_CheckRadioInterrupts(void)
@ -675,12 +690,14 @@ void APP_Update(void)
gScheduleScanListen = false; gScheduleScanListen = false;
} }
#if defined(ENABLE_NOAA)
if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gIsNoaaMode && gScheduleNOAA && gVoiceWriteIndex == 0) { if (gEeprom.DUAL_WATCH == DUAL_WATCH_OFF && gIsNoaaMode && gScheduleNOAA && gVoiceWriteIndex == 0) {
NOAA_NextChannel(); NOAA_NextChannel();
RADIO_SetupRegisters(false); RADIO_SetupRegisters(false);
gScheduleNOAA = false; gScheduleNOAA = false;
gNOAA_Countdown = 7; gNOAA_Countdown = 7;
} }
#endif
if (gScreenToDisplay != DISPLAY_SCANNER && gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) { if (gScreenToDisplay != DISPLAY_SCANNER && gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) {
if (gScheduleDualWatch && gVoiceWriteIndex == 0) { if (gScheduleDualWatch && gVoiceWriteIndex == 0) {
@ -725,7 +742,11 @@ void APP_Update(void)
) { ) {
gBatterySaveCountdown = 1000; gBatterySaveCountdown = 1000;
} 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]))
#if defined(ENABLE_NOAA)
|| !gIsNoaaMode
#endif
) {
FUNCTION_Select(FUNCTION_POWER_SAVE); FUNCTION_Select(FUNCTION_POWER_SAVE);
} else { } else {
gBatterySaveCountdown = 1000; gBatterySaveCountdown = 1000;
@ -1068,6 +1089,7 @@ void APP_TimeSlice500ms(void)
return; return;
} }
#endif #endif
if (gReducedService) { if (gReducedService) {
BOARD_ADC_GetBatteryInfo(&gBatteryCurrentVoltage, &gBatteryCurrent); BOARD_ADC_GetBatteryInfo(&gBatteryCurrentVoltage, &gBatteryCurrent);
if (gBatteryCurrent > 500 || gBatteryCalibration[3] < gBatteryCurrentVoltage) { if (gBatteryCurrent > 500 || gBatteryCalibration[3] < gBatteryCurrentVoltage) {
@ -1573,7 +1595,9 @@ Skip:
if (gFlagReconfigureVfos) { if (gFlagReconfigureVfos) {
RADIO_SelectVfos(); RADIO_SelectVfos();
#if defined(ENABLE_NOAA)
RADIO_ConfigureNOAA(); RADIO_ConfigureNOAA();
#endif
RADIO_SetupRegisters(true); RADIO_SetupRegisters(true);
gDTMF_AUTO_RESET_TIME = 0; gDTMF_AUTO_RESET_TIME = 0;
gDTMF_CallState = DTMF_CALL_STATE_NONE; gDTMF_CallState = DTMF_CALL_STATE_NONE;

View File

@ -106,6 +106,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
} }
} }
} else { } else {
#if defined(ENABLE_NOAA)
uint8_t Channel; uint8_t Channel;
if (gInputBoxIndex != 2) { if (gInputBoxIndex != 2) {
@ -124,6 +125,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gVfoConfigureMode = VFO_CONFIGURE_RELOAD; gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
return; return;
} }
#endif
} }
gRequestDisplayScreen = DISPLAY_MAIN; gRequestDisplayScreen = DISPLAY_MAIN;
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL; gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
@ -216,6 +218,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
break; break;
case KEY_5: case KEY_5:
#if defined(ENABLE_NOAA)
if (IS_NOT_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE)) { if (IS_NOT_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE)) {
gEeprom.ScreenChannel[Vfo] = gEeprom.NoaaChannel[gEeprom.TX_CHANNEL]; gEeprom.ScreenChannel[Vfo] = gEeprom.NoaaChannel[gEeprom.TX_CHANNEL];
} else { } else {
@ -224,6 +227,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
} }
gRequestSaveVFO = true; gRequestSaveVFO = true;
gVfoConfigureMode = VFO_CONFIGURE_RELOAD; gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
#endif
break; break;
case KEY_6: case KEY_6:
@ -403,9 +407,11 @@ static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
gAnotherVoiceID = (VOICE_ID_t)0xFE; gAnotherVoiceID = (VOICE_ID_t)0xFE;
} }
} else { } else {
#if defined(ENABLE_NOAA)
Channel = NOAA_CHANNEL_FIRST + NUMBER_AddWithWraparound(gEeprom.ScreenChannel[gEeprom.TX_CHANNEL] - NOAA_CHANNEL_FIRST, Direction, 0, 9); Channel = NOAA_CHANNEL_FIRST + NUMBER_AddWithWraparound(gEeprom.ScreenChannel[gEeprom.TX_CHANNEL] - NOAA_CHANNEL_FIRST, Direction, 0, 9);
gEeprom.NoaaChannel[gEeprom.TX_CHANNEL] = Channel; gEeprom.NoaaChannel[gEeprom.TX_CHANNEL] = Channel;
gEeprom.ScreenChannel[gEeprom.TX_CHANNEL] = Channel; gEeprom.ScreenChannel[gEeprom.TX_CHANNEL] = Channel;
#endif
} }
gRequestSaveVFO = true; gRequestSaveVFO = true;
gVfoConfigureMode = VFO_CONFIGURE_RELOAD; gVfoConfigureMode = VFO_CONFIGURE_RELOAD;

View File

@ -153,7 +153,10 @@ int MENU_GetLimits(uint8_t Cursor, uint8_t *pMin, uint8_t *pMax)
case MENU_S_ADD1: case MENU_S_ADD2: case MENU_S_ADD1: case MENU_S_ADD2:
case MENU_STE: case MENU_AL_MOD: case MENU_STE: case MENU_AL_MOD:
case MENU_D_ST: case MENU_D_DCD: case MENU_D_ST: case MENU_D_DCD:
case MENU_AM: case MENU_NOAA_S: case MENU_AM:
#if defined(ENABLE_NOAA)
case MENU_NOAA_S:
#endif
case MENU_RESET: case MENU_350TX: case MENU_RESET: case MENU_350TX:
case MENU_200TX: case MENU_500TX: case MENU_200TX: case MENU_500TX:
case MENU_350EN: case MENU_SCREN: case MENU_350EN: case MENU_SCREN:
@ -471,11 +474,13 @@ void MENU_AcceptSetting(void)
gRequestSaveChannel = 1; gRequestSaveChannel = 1;
return; return;
#if defined(ENABLE_NOAA)
case MENU_NOAA_S: case MENU_NOAA_S:
gEeprom.NOAA_AUTO_SCAN = gSubMenuSelection; gEeprom.NOAA_AUTO_SCAN = gSubMenuSelection;
gRequestSaveSettings = true; gRequestSaveSettings = true;
gFlagReconfigureVfos = true; gFlagReconfigureVfos = true;
return; return;
#endif
case MENU_DEL_CH: case MENU_DEL_CH:
SETTINGS_UpdateChannel(gSubMenuSelection, NULL, false); SETTINGS_UpdateChannel(gSubMenuSelection, NULL, false);
@ -792,9 +797,11 @@ void MENU_ShowCurrentSetting(void)
gSubMenuSelection = gTxVfo->AM_CHANNEL_MODE; gSubMenuSelection = gTxVfo->AM_CHANNEL_MODE;
break; break;
#if defined(ENABLE_NOAA)
case MENU_NOAA_S: case MENU_NOAA_S:
gSubMenuSelection = gEeprom.NOAA_AUTO_SCAN; gSubMenuSelection = gEeprom.NOAA_AUTO_SCAN;
break; break;
#endif
case MENU_DEL_CH: case MENU_DEL_CH:
gSubMenuSelection = RADIO_FindNextChannel(gEeprom.MrChannel[0], 1, false, 1); gSubMenuSelection = RADIO_FindNextChannel(gEeprom.MrChannel[0], 1, false, 1);

View File

@ -306,7 +306,9 @@ void SCANNER_Start(void)
RADIO_SetupRegisters(true); RADIO_SetupRegisters(true);
#if defined(ENABLE_NOAA)
gIsNoaaMode = false; gIsNoaaMode = false;
#endif
if (gScanSingleFrequency) { if (gScanSingleFrequency) {
gScanCssState = SCAN_CSS_STATE_SCANNING; gScanCssState = SCAN_CSS_STATE_SCANNING;
gScanFrequency = gRxVfo->pRX->Frequency; gScanFrequency = gRxVfo->pRX->Frequency;

View File

@ -382,7 +382,9 @@ static void CMD_052F(const uint8_t *pBuffer)
gEeprom.VfoInfo[0].FREQUENCY_DEVIATION_SETTING = FREQUENCY_DEVIATION_OFF; gEeprom.VfoInfo[0].FREQUENCY_DEVIATION_SETTING = FREQUENCY_DEVIATION_OFF;
gEeprom.VfoInfo[0].DTMF_PTT_ID_TX_MODE = PTT_ID_OFF; gEeprom.VfoInfo[0].DTMF_PTT_ID_TX_MODE = PTT_ID_OFF;
gEeprom.VfoInfo[0].DTMF_DECODING_ENABLE = false; gEeprom.VfoInfo[0].DTMF_DECODING_ENABLE = false;
#if defined(ENABLE_NOAA)
gIsNoaaMode = false; gIsNoaaMode = false;
#endif
if (gCurrentFunction == FUNCTION_POWER_SAVE) { if (gCurrentFunction == FUNCTION_POWER_SAVE) {
FUNCTION_Select(FUNCTION_FOREGROUND); FUNCTION_Select(FUNCTION_FOREGROUND);
} }

View File

@ -22,7 +22,9 @@ const uint8_t BITMAP_VoicePrompt[9] = { 0x00, 0x18, 0x18, 0x24, 0x24, 0x42, 0x42
#if defined(ENABLE_FMRADIO) #if defined(ENABLE_FMRADIO)
const uint8_t BITMAP_FM[12] = { 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F }; const uint8_t BITMAP_FM[12] = { 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F };
#endif #endif
#if defined(ENABLE_NOAA)
const uint8_t BITMAP_NOAA[12] = { 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, 0x46, 0x49, 0x49, 0x49, 0x31 }; const uint8_t BITMAP_NOAA[12] = { 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, 0x46, 0x49, 0x49, 0x49, 0x31 };
#endif
const uint8_t BITMAP_Antenna[5] = { 0x03, 0x05, 0x7F, 0x05, 0x03 }; const uint8_t BITMAP_Antenna[5] = { 0x03, 0x05, 0x7F, 0x05, 0x03 };
const uint8_t BITMAP_AntennaLevel1[3] = { 0x60, 0x60, 0x00 }; const uint8_t BITMAP_AntennaLevel1[3] = { 0x60, 0x60, 0x00 };

View File

@ -48,6 +48,7 @@ const uint32_t UpperLimitFrequencyBandTable[7] = {
60000000, 60000000,
}; };
#if defined(ENABLE_NOAA)
const uint32_t NoaaFrequencyTable[10] = { const uint32_t NoaaFrequencyTable[10] = {
16255000, 16255000,
16240000, 16240000,
@ -60,6 +61,7 @@ const uint32_t NoaaFrequencyTable[10] = {
16177500, 16177500,
16327500, 16327500,
}; };
#endif
const uint16_t StepFrequencyTable[6] = { const uint16_t StepFrequencyTable[6] = {
250, 250,

View File

@ -35,7 +35,9 @@ typedef enum FREQUENCY_Band_t FREQUENCY_Band_t;
extern const uint32_t LowerLimitFrequencyBandTable[7]; extern const uint32_t LowerLimitFrequencyBandTable[7];
extern const uint32_t MiddleFrequencyBandTable[7]; extern const uint32_t MiddleFrequencyBandTable[7];
extern const uint32_t UpperLimitFrequencyBandTable[7]; extern const uint32_t UpperLimitFrequencyBandTable[7];
#if defined(ENABLE_NOAA)
extern const uint32_t NoaaFrequencyTable[10]; extern const uint32_t NoaaFrequencyTable[10];
#endif
extern const uint16_t StepFrequencyTable[6]; extern const uint16_t StepFrequencyTable[6];
FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency); FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency);

View File

@ -62,7 +62,10 @@ void BOOT_ProcessMode(BOOT_Mode_t Mode)
gMenuCursor = MENU_350TX; gMenuCursor = MENU_350TX;
gSubMenuSelection = gSetting_350TX; gSubMenuSelection = gSetting_350TX;
GUI_SelectNextDisplay(DISPLAY_MENU); GUI_SelectNextDisplay(DISPLAY_MENU);
gMenuListCount = 57; gMenuListCount = 56;
#if defined(ENABLE_NOAA)
gMenuListCount++;
#endif
gF_LOCK = true; gF_LOCK = true;
#if defined(ENABLE_AIRCOPY) #if defined(ENABLE_AIRCOPY)
} else if (Mode == BOOT_MODE_AIRCOPY) { } else if (Mode == BOOT_MODE_AIRCOPY) {

7
main.c
View File

@ -104,7 +104,10 @@ void Main(void)
UI_DisplayWelcome(); UI_DisplayWelcome();
BACKLIGHT_TurnOn(); BACKLIGHT_TurnOn();
SYSTEM_DelayMs(1000); SYSTEM_DelayMs(1000);
gMenuListCount = 51; gMenuListCount = 50;
#if defined(ENABLE_NOAA)
gMenuListCount++;
#endif
BootMode = BOOT_GetMode(); BootMode = BOOT_GetMode();
if (gEeprom.POWER_ON_PASSWORD < 1000000) { if (gEeprom.POWER_ON_PASSWORD < 1000000) {
@ -126,7 +129,9 @@ void Main(void)
AUDIO_SetVoiceID(1, VOICE_ID_FREQUENCY_MODE); AUDIO_SetVoiceID(1, VOICE_ID_FREQUENCY_MODE);
} }
AUDIO_PlaySingleVoice(0); AUDIO_PlaySingleVoice(0);
#if defined(ENABLE_NOAA)
RADIO_ConfigureNOAA(); RADIO_ConfigureNOAA();
#endif
} }
while (1) { while (1) {

8
misc.c
View File

@ -57,7 +57,9 @@ volatile uint16_t gBatterySaveCountdown = 1000;
volatile uint16_t gDualWatchCountdown; volatile uint16_t gDualWatchCountdown;
volatile uint16_t gTxTimerCountdown; volatile uint16_t gTxTimerCountdown;
volatile uint16_t gTailNoteEliminationCountdown; volatile uint16_t gTailNoteEliminationCountdown;
#if defined(ENABLE_NOAA)
volatile uint16_t gNOAA_Countdown; volatile uint16_t gNOAA_Countdown;
#endif
bool gEnableSpeaker; bool gEnableSpeaker;
uint8_t gKeyLockCountdown; uint8_t gKeyLockCountdown;
uint8_t gRTTECountdown; uint8_t gRTTECountdown;
@ -129,9 +131,13 @@ uint8_t gAircopySendCountdown;
uint8_t gFSKWriteIndex; uint8_t gFSKWriteIndex;
uint8_t gNeverUsed; uint8_t gNeverUsed;
#if defined(ENABLE_NOAA)
bool gIsNoaaMode; bool gIsNoaaMode;
#endif
volatile bool gNextTimeslice; volatile bool gNextTimeslice;
#if defined(ENABLE_NOAA)
uint8_t gNoaaChannel; uint8_t gNoaaChannel;
#endif
bool gUpdateDisplay; bool gUpdateDisplay;
bool gF_LOCK; bool gF_LOCK;
uint8_t gShowChPrefix; uint8_t gShowChPrefix;
@ -144,7 +150,9 @@ volatile bool gNextTimeslice40ms;
volatile bool gSchedulePowerSave; volatile bool gSchedulePowerSave;
volatile bool gBatterySaveCountdownExpired; volatile bool gBatterySaveCountdownExpired;
volatile bool gScheduleDualWatch = true; volatile bool gScheduleDualWatch = true;
#if defined(ENABLE_NOAA)
volatile bool gScheduleNOAA = true; volatile bool gScheduleNOAA = true;
#endif
volatile bool gFlagTteComplete; volatile bool gFlagTteComplete;
#if defined(ENABLE_FMRADIO) #if defined(ENABLE_FMRADIO)
volatile bool gScheduleFM; volatile bool gScheduleFM;

8
misc.h
View File

@ -108,7 +108,9 @@ 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;
extern volatile uint16_t gFmPlayCountdown; extern volatile uint16_t gFmPlayCountdown;
#if defined(ENABLE_NOAA)
extern volatile uint16_t gNOAA_Countdown; extern volatile uint16_t gNOAA_Countdown;
#endif
extern bool gEnableSpeaker; extern bool gEnableSpeaker;
extern uint8_t gKeyLockCountdown; extern uint8_t gKeyLockCountdown;
extern uint8_t gRTTECountdown; extern uint8_t gRTTECountdown;
@ -180,9 +182,13 @@ extern uint8_t gAircopySendCountdown;
extern uint8_t gFSKWriteIndex; extern uint8_t gFSKWriteIndex;
extern uint8_t gNeverUsed; extern uint8_t gNeverUsed;
#if defined(ENABLE_NOAA)
extern bool gIsNoaaMode; extern bool gIsNoaaMode;
#endif
extern volatile bool gNextTimeslice; extern volatile bool gNextTimeslice;
#if defined(ENABLE_NOAA)
extern uint8_t gNoaaChannel; extern uint8_t gNoaaChannel;
#endif
extern bool gUpdateDisplay; extern bool gUpdateDisplay;
extern bool gF_LOCK; extern bool gF_LOCK;
extern uint8_t gShowChPrefix; extern uint8_t gShowChPrefix;
@ -195,7 +201,9 @@ extern volatile bool gNextTimeslice40ms;
extern volatile bool gSchedulePowerSave; extern volatile bool gSchedulePowerSave;
extern volatile bool gBatterySaveCountdownExpired; extern volatile bool gBatterySaveCountdownExpired;
extern volatile bool gScheduleDualWatch; extern volatile bool gScheduleDualWatch;
#if defined(ENABLE_NOAA)
extern volatile bool gScheduleNOAA; extern volatile bool gScheduleNOAA;
#endif
extern volatile bool gFlagTteComplete; extern volatile bool gFlagTteComplete;
#if defined(ENABLE_FMRADIO) #if defined(ENABLE_FMRADIO)
extern volatile bool gScheduleFM; extern volatile bool gScheduleFM;

View File

@ -154,6 +154,7 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
Channel = gEeprom.ScreenChannel[VFO]; Channel = gEeprom.ScreenChannel[VFO];
if (IS_VALID_CHANNEL(Channel)) { if (IS_VALID_CHANNEL(Channel)) {
#if defined(ENABLE_NOAA)
if (Channel >= NOAA_CHANNEL_FIRST) { if (Channel >= NOAA_CHANNEL_FIRST) {
RADIO_InitInfo(pRadio, gEeprom.ScreenChannel[VFO], 2, NoaaFrequencyTable[Channel - NOAA_CHANNEL_FIRST]); RADIO_InitInfo(pRadio, gEeprom.ScreenChannel[VFO], 2, NoaaFrequencyTable[Channel - NOAA_CHANNEL_FIRST]);
if (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) { if (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) {
@ -163,6 +164,7 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF; gEeprom.CROSS_BAND_RX_TX = CROSS_BAND_OFF;
return; return;
} }
#endif
if (IS_MR_CHANNEL(Channel)) { if (IS_MR_CHANNEL(Channel)) {
Channel = RADIO_FindNextChannel(Channel, RADIO_CHANNEL_UP, false, VFO); Channel = RADIO_FindNextChannel(Channel, RADIO_CHANNEL_UP, false, VFO);
if (Channel == 0xFF) { if (Channel == 0xFF) {
@ -504,11 +506,15 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
} }
BK4819_WriteRegister(BK4819_REG_3F, 0); BK4819_WriteRegister(BK4819_REG_3F, 0);
BK4819_WriteRegister(BK4819_REG_7D, gEeprom.MIC_SENSITIVITY_TUNING | 0xE940); BK4819_WriteRegister(BK4819_REG_7D, gEeprom.MIC_SENSITIVITY_TUNING | 0xE940);
#if defined(ENABLE_NOAA)
if (IS_NOT_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE) || !gIsNoaaMode) { if (IS_NOT_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE) || !gIsNoaaMode) {
Frequency = gRxVfo->pRX->Frequency; Frequency = gRxVfo->pRX->Frequency;
} else { } else {
Frequency = NoaaFrequencyTable[gNoaaChannel]; Frequency = NoaaFrequencyTable[gNoaaChannel];
} }
#else
Frequency = gRxVfo->pRX->Frequency;
#endif
BK4819_SetFrequency(Frequency); BK4819_SetFrequency(Frequency);
BK4819_SetupSquelch( BK4819_SetupSquelch(
gRxVfo->SquelchOpenRSSIThresh, gRxVfo->SquelchCloseRSSIThresh, gRxVfo->SquelchOpenRSSIThresh, gRxVfo->SquelchCloseRSSIThresh,
@ -611,6 +617,7 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0)
} }
} }
#if defined(ENABLE_NOAA)
void RADIO_ConfigureNOAA(void) void RADIO_ConfigureNOAA(void)
{ {
uint8_t ChanAB; uint8_t ChanAB;
@ -645,6 +652,7 @@ void RADIO_ConfigureNOAA(void)
gIsNoaaMode = false; gIsNoaaMode = false;
} }
} }
#endif
void RADIO_SetTxParameters(void) void RADIO_SetTxParameters(void)
{ {

View File

@ -72,6 +72,7 @@ void SystickHandler(void)
} }
} }
#if defined(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) {
@ -79,6 +80,7 @@ void SystickHandler(void)
} }
} }
} }
#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) {

View File

@ -166,6 +166,7 @@ void UI_DisplayMain(void)
c = (gEeprom.ScreenChannel[i] - FREQ_CHANNEL_FIRST) + 1; c = (gEeprom.ScreenChannel[i] - FREQ_CHANNEL_FIRST) + 1;
UI_DisplaySmallDigits(1, &c, 22, Line + 1); UI_DisplaySmallDigits(1, &c, 22, Line + 1);
} else { } else {
#if defined(ENABLE_NOAA)
memcpy(pLine1 + 7, BITMAP_NarrowBand, sizeof(BITMAP_NarrowBand)); memcpy(pLine1 + 7, BITMAP_NarrowBand, sizeof(BITMAP_NarrowBand));
if (gInputBoxIndex == 0 || gEeprom.TX_CHANNEL != i) { if (gInputBoxIndex == 0 || gEeprom.TX_CHANNEL != i) {
NUMBER_ToDigits((gEeprom.ScreenChannel[i] - NOAA_CHANNEL_FIRST) + 1, String); NUMBER_ToDigits((gEeprom.ScreenChannel[i] - NOAA_CHANNEL_FIRST) + 1, String);
@ -174,6 +175,7 @@ void UI_DisplayMain(void)
String[7] = gInputBox[1]; String[7] = gInputBox[1];
} }
UI_DisplaySmallDigits(2, String + 6, 15, Line + 1); UI_DisplaySmallDigits(2, String + 6, 15, Line + 1);
#endif
} }
// 0x8FEC // 0x8FEC

View File

@ -48,7 +48,10 @@ static const char MenuList[][7] = {
"D-PRE", "PTT-ID", "D-DCD", "D-LIST", "D-PRE", "PTT-ID", "D-DCD", "D-LIST",
"PONMSG", "ROGER", "VOL", "AM", "PONMSG", "ROGER", "VOL", "AM",
// 0x30 // 0x30
"NOAA_S", "DEL-CH", "RESET", "350TX", #if defined(ENABLE_NOAA)
"NOAA_S",
#endif
"DEL-CH", "RESET", "350TX",
"F-LOCK", "200TX", "500TX", "350EN", "F-LOCK", "200TX", "500TX", "350EN",
// 0x38 // 0x38
"SCREN", "SCREN",
@ -288,7 +291,9 @@ void UI_DisplayMenu(void)
case MENU_D_ST: case MENU_D_ST:
case MENU_D_DCD: case MENU_D_DCD:
case MENU_AM: case MENU_AM:
#if defined(ENABLE_NOAA)
case MENU_NOAA_S: case MENU_NOAA_S:
#endif
case MENU_350TX: case MENU_350TX:
case MENU_200TX: case MENU_200TX:
case MENU_500TX: case MENU_500TX:

114
ui/menu.h
View File

@ -22,62 +22,64 @@
enum { enum {
MENU_SQL = 0, MENU_SQL = 0,
MENU_STEP = 1, MENU_STEP,
MENU_TXP = 2, MENU_TXP,
MENU_R_DCS = 3, MENU_R_DCS,
MENU_R_CTCS = 4, MENU_R_CTCS,
MENU_T_DCS = 5, MENU_T_DCS,
MENU_T_CTCS = 6, MENU_T_CTCS,
MENU_SFT_D = 7, MENU_SFT_D,
MENU_OFFSET = 8, MENU_OFFSET,
MENU_W_N = 9, MENU_W_N,
MENU_SCR = 10, MENU_SCR,
MENU_BCL = 11, MENU_BCL,
MENU_MEM_CH = 12, MENU_MEM_CH,
MENU_SAVE = 13, MENU_SAVE,
MENU_VOX = 14, MENU_VOX,
MENU_ABR = 15, MENU_ABR,
MENU_TDR = 16, MENU_TDR,
MENU_WX = 17, MENU_WX,
MENU_BEEP = 18, MENU_BEEP,
MENU_TOT = 19, MENU_TOT,
MENU_VOICE = 20, MENU_VOICE,
MENU_SC_REV = 21, MENU_SC_REV,
MENU_MDF = 22, MENU_MDF,
MENU_AUTOLK = 23, MENU_AUTOLK,
MENU_S_ADD1 = 24, MENU_S_ADD1,
MENU_S_ADD2 = 25, MENU_S_ADD2,
MENU_STE = 26, MENU_STE,
MENU_RP_STE = 27, MENU_RP_STE,
MENU_MIC = 28, MENU_MIC,
MENU_1_CALL = 29, MENU_1_CALL,
MENU_S_LIST = 30, MENU_S_LIST,
MENU_SLIST1 = 31, MENU_SLIST1,
MENU_SLIST2 = 32, MENU_SLIST2,
MENU_AL_MOD = 33, MENU_AL_MOD,
MENU_ANI_ID = 34, MENU_ANI_ID,
MENU_UPCODE = 35, MENU_UPCODE,
MENU_DWCODE = 36, MENU_DWCODE,
MENU_D_ST = 37, MENU_D_ST,
MENU_D_RSP = 38, MENU_D_RSP,
MENU_D_HOLD = 39, MENU_D_HOLD,
MENU_D_PRE = 40, MENU_D_PRE,
MENU_PTT_ID = 41, MENU_PTT_ID,
MENU_D_DCD = 42, MENU_D_DCD,
MENU_D_LIST = 43, MENU_D_LIST,
MENU_PONMSG = 44, MENU_PONMSG,
MENU_ROGER = 45, MENU_ROGER,
MENU_VOL = 46, MENU_VOL,
MENU_AM = 47, MENU_AM,
MENU_NOAA_S = 48, #if defined(ENABLE_NOAA)
MENU_DEL_CH = 49, MENU_NOAA_S,
MENU_RESET = 50, #endif
MENU_350TX = 51, MENU_DEL_CH,
MENU_F_LOCK = 52, MENU_RESET,
MENU_200TX = 53, MENU_350TX,
MENU_500TX = 54, MENU_F_LOCK,
MENU_350EN = 55, MENU_200TX,
MENU_SCREN = 56, MENU_500TX,
MENU_350EN,
MENU_SCREN,
}; };
extern bool gIsInSubMenu; extern bool gIsInSubMenu;

View File

@ -77,9 +77,11 @@ void UI_DisplayStatus(void)
memcpy(gStatusLine + 21, BITMAP_FM, sizeof(BITMAP_FM)); memcpy(gStatusLine + 21, BITMAP_FM, sizeof(BITMAP_FM));
} }
#endif #endif
#if defined(ENABLE_NOAA)
if (gIsNoaaMode) { if (gIsNoaaMode) {
memcpy(gStatusLine + 7, BITMAP_NOAA, sizeof(BITMAP_NOAA)); memcpy(gStatusLine + 7, BITMAP_NOAA, sizeof(BITMAP_NOAA));
} }
#endif
ST7565_BlitStatusLine(); ST7565_BlitStatusLine();
} }