This commit is contained in:
Krzysiek Egzmont
2023-12-26 01:29:17 +01:00
parent 995045006f
commit 1882ab0cc1
4 changed files with 56 additions and 58 deletions

View File

@@ -124,7 +124,7 @@ void ACTION_Monitor(void)
if (gCurrentFunction != FUNCTION_MONITOR) { // enable the monitor
RADIO_SelectVfos();
#ifdef ENABLE_NOAA
if (gRxVfo->CHANNEL_SAVE >= NOAA_CHANNEL_FIRST && gIsNoaaMode)
if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE) && gIsNoaaMode)
gNoaaChannel = gRxVfo->CHANNEL_SAVE - NOAA_CHANNEL_FIRST;
#endif
RADIO_SetupRegisters(true);

View File

@@ -553,7 +553,7 @@ static void DualwatchAlternate(void)
gRxVfo = &gEeprom.VfoInfo[gEeprom.RX_VFO];
if (gEeprom.VfoInfo[0].CHANNEL_SAVE >= NOAA_CHANNEL_FIRST)
if (IS_NOAA_CHANNEL(gEeprom.VfoInfo[0].CHANNEL_SAVE))
NOAA_IncreaseChannel();
}
else

View File

@@ -166,7 +166,7 @@ void RADIO_ConfigureChannel(const unsigned int VFO, const unsigned int configure
if (IS_VALID_CHANNEL(channel)) {
#ifdef ENABLE_NOAA
if (channel >= NOAA_CHANNEL_FIRST)
if (IS_NOAA_CHANNEL(channel))
{
RADIO_InitInfo(pVfo, gEeprom.ScreenChannel[VFO], NoaaFrequencyTable[channel - NOAA_CHANNEL_FIRST]);
@@ -805,7 +805,7 @@ void RADIO_SetupRegisters(bool switchToForeground)
return;
}
if (gRxVfo->CHANNEL_SAVE >= NOAA_CHANNEL_FIRST)
if (IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE))
{
gIsNoaaMode = true;
gNoaaChannel = gRxVfo->CHANNEL_SAVE - NOAA_CHANNEL_FIRST;

View File

@@ -594,20 +594,18 @@ void SETTINGS_SaveSettings(void)
void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO, uint8_t Mode)
{
#ifdef ENABLE_NOAA
if (!IS_NOAA_CHANNEL(Channel))
if (IS_NOAA_CHANNEL(Channel))
return;
#endif
{
uint16_t OffsetVFO = Channel * 16;
if (!IS_MR_CHANNEL(Channel))
{ // it's a VFO, not a channel
if (IS_FREQ_CHANNEL(Channel)) { // it's a VFO, not a channel
OffsetVFO = (VFO == 0) ? 0x0C80 : 0x0C90;
OffsetVFO += (Channel - FREQ_CHANNEL_FIRST) * 32;
}
if (Mode >= 2 || !IS_MR_CHANNEL(Channel))
{ // copy VFO to a channel
if (Mode >= 2 || IS_FREQ_CHANNEL(Channel)) { // copy VFO to a channel
union {
uint8_t _8[8];
uint32_t _32[2];
@@ -648,7 +646,7 @@ void SETTINGS_SaveChannel(uint8_t Channel, uint8_t VFO, const VFO_Info_t *pVFO,
#endif
}
}
}
}
void SETTINGS_SaveBatteryCalibration(const uint16_t * batteryCalibration)