Renamed channel fields in the EEPROM.

This commit is contained in:
Dual Tachyon 2023-08-28 12:05:15 +01:00
parent f169f95535
commit 4b1ad7c2dd
11 changed files with 104 additions and 104 deletions

View File

@ -247,8 +247,8 @@ void FUN_0000773c(void)
if (g_20000413 != 1) {
if (g_20000410 < 200) {
gEeprom.EEPROM_0E81_0E84[gEeprom.RX_CHANNEL] = g_20000414;
gEeprom.VfoChannel[gEeprom.RX_CHANNEL] = Previous;
gEeprom.MrChannel[gEeprom.RX_CHANNEL] = g_20000414;
gEeprom.ScreenChannel[gEeprom.RX_CHANNEL] = Previous;
RADIO_ConfigureChannel(gEeprom.RX_CHANNEL, 2);
} else {
gInfoCHAN_A->DCS[0].Frequency = g_20000418;
@ -463,7 +463,7 @@ void FUN_000069f8(FUNCTION_Type_t Function)
gInfoCHAN_A->CHANNEL_SAVE = gNoaaChannel + 207;
gInfoCHAN_A->pDCS_Current->Frequency = NoaaFrequencyTable[gNoaaChannel];
gInfoCHAN_A->pDCS_Reverse->Frequency = NoaaFrequencyTable[gNoaaChannel];
gEeprom.VfoChannel[gEeprom.RX_CHANNEL] = gInfoCHAN_A->CHANNEL_SAVE;
gEeprom.ScreenChannel[gEeprom.RX_CHANNEL] = gInfoCHAN_A->CHANNEL_SAVE;
g_20000356 = 500;
gSystickFlag8 = false;
}
@ -561,8 +561,8 @@ void FUN_00007dd4(void)
g_20000410 = Ch;
if (PreviousCh != g_20000410) {
gEeprom.EEPROM_0E81_0E84[gEeprom.RX_CHANNEL] = g_20000410;
gEeprom.VfoChannel[gEeprom.RX_CHANNEL] = g_20000410;
gEeprom.MrChannel[gEeprom.RX_CHANNEL] = g_20000410;
gEeprom.ScreenChannel[gEeprom.RX_CHANNEL] = g_20000410;
RADIO_ConfigureChannel(gEeprom.RX_CHANNEL, 2);
RADIO_SetupRegisters(true);
gUpdateDisplay = true;
@ -588,7 +588,7 @@ void NOAA_IncreaseChannel(void)
void FUN_00007f4c(void)
{
if (gIsNoaaMode) {
if (gEeprom.VfoChannel[0] < 207 || gEeprom.VfoChannel[1] < 207) {
if (gEeprom.ScreenChannel[0] < 207 || gEeprom.ScreenChannel[1] < 207) {
gEeprom.RX_CHANNEL = gEeprom.RX_CHANNEL == 0;
} else {
gEeprom.RX_CHANNEL = 0;
@ -915,7 +915,7 @@ void APP_Update(void)
if (gEeprom.BATTERY_SAVE == 0 || gStepDirection || g_20000381 || gFmRadioMode || gPttIsPressed || gScreenToDisplay != DISPLAY_MAIN || gKeyBeingHeld || g_200003BC) {
g_2000032E = 1000;
} else {
if ((gEeprom.VfoChannel[0] < 207 && gEeprom.VfoChannel[1] < 207) || !gIsNoaaMode) {
if ((gEeprom.ScreenChannel[0] < 207 && gEeprom.ScreenChannel[1] < 207) || !gIsNoaaMode) {
FUNCTION_Select(FUNCTION_POWER_SAVE);
} else {
g_2000032E = 1000;

View File

@ -47,8 +47,8 @@ void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
return;
}
gAnotherVoiceID = (VOICE_ID_t)Key;
gEeprom.EEPROM_0E81_0E84[Vfo] = (uint8_t)Channel;
gEeprom.VfoChannel[Vfo] = Channel;
gEeprom.MrChannel[Vfo] = (uint8_t)Channel;
gEeprom.ScreenChannel[Vfo] = (uint8_t)Channel;
gRequestSaveVFO = true;
g_2000039A = 2;
return;
@ -71,8 +71,8 @@ void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gAnotherVoiceID = (VOICE_ID_t)Key;
if (gTxRadioInfo->Band != i) {
gTxRadioInfo->Band = i;
gEeprom.VfoChannel[Vfo] = i + 200;
gEeprom.EEPROM_0E82_0E85[Vfo] = i + 200;
gEeprom.ScreenChannel[Vfo] = i + 200;
gEeprom.FreqChannel[Vfo] = i + 200;
SETTINGS_SaveVfoIndices();
RADIO_ConfigureChannel(Vfo, 2);
}
@ -103,7 +103,7 @@ void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
Channel += 207;
gAnotherVoiceID = (VOICE_ID_t)Key;
gEeprom.NoaaChannel[Vfo] = Channel;
gEeprom.VfoChannel[Vfo] = Channel;
gEeprom.ScreenChannel[Vfo] = Channel;
gRequestSaveVFO = true;
g_2000039A = 2;
return;
@ -143,15 +143,15 @@ void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
uint8_t Channel;
if (gTxRadioInfo->CHANNEL_SAVE < 200) {
gEeprom.VfoChannel[Vfo] = gEeprom.EEPROM_0E82_0E85[gEeprom.TX_CHANNEL];
gEeprom.ScreenChannel[Vfo] = gEeprom.FreqChannel[gEeprom.TX_CHANNEL];
gAnotherVoiceID = VOICE_ID_FREQUENCY_MODE;
gRequestSaveVFO = true;
g_2000039A = 2;
break;
}
Channel = RADIO_FindNextChannel(gEeprom.EEPROM_0E81_0E84[gEeprom.TX_CHANNEL], 1, false, 0);
Channel = RADIO_FindNextChannel(gEeprom.MrChannel[gEeprom.TX_CHANNEL], 1, false, 0);
if (Channel != 0xFF) {
gEeprom.VfoChannel[Vfo] = Channel;
gEeprom.ScreenChannel[Vfo] = Channel;
AUDIO_SetVoiceID(0, VOICE_ID_CHANNEL_MODE);
AUDIO_SetDigitVoice(1, Channel + 1);
gAnotherVoiceID = 0xFE;
@ -175,9 +175,9 @@ void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
case KEY_5:
if (gTxRadioInfo->CHANNEL_SAVE < 207) {
gEeprom.VfoChannel[Vfo] = gEeprom.NoaaChannel[gEeprom.TX_CHANNEL];
gEeprom.ScreenChannel[Vfo] = gEeprom.NoaaChannel[gEeprom.TX_CHANNEL];
} else {
gEeprom.VfoChannel[Vfo] = gEeprom.EEPROM_0E82_0E85[gEeprom.TX_CHANNEL];
gEeprom.ScreenChannel[Vfo] = gEeprom.FreqChannel[gEeprom.TX_CHANNEL];
gAnotherVoiceID = VOICE_ID_FREQUENCY_MODE;
}
gRequestSaveVFO = true;
@ -246,7 +246,7 @@ void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
{
uint8_t Channel;
Channel = gEeprom.VfoChannel[gEeprom.TX_CHANNEL];
Channel = gEeprom.ScreenChannel[gEeprom.TX_CHANNEL];
if (bKeyHeld || !bKeyPressed) {
if (gNumberOffset != 0) {
return;
@ -286,16 +286,16 @@ void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
if (Channel == Next) {
return;
}
gEeprom.EEPROM_0E81_0E84[gEeprom.TX_CHANNEL] = Next;
gEeprom.VfoChannel[gEeprom.TX_CHANNEL] = Next;
gEeprom.MrChannel[gEeprom.TX_CHANNEL] = Next;
gEeprom.ScreenChannel[gEeprom.TX_CHANNEL] = Next;
if (!bKeyHeld) {
AUDIO_SetDigitVoice(0, Next + 1);
gAnotherVoiceID = 0xFE;
}
} else {
Channel = 207 + NUMBER_AddWithWraparound(gEeprom.VfoChannel[gEeprom.TX_CHANNEL] + 207,Direction, 0, 9);
Channel = 207 + NUMBER_AddWithWraparound(gEeprom.ScreenChannel[gEeprom.TX_CHANNEL] + 207,Direction, 0, 9);
gEeprom.NoaaChannel[gEeprom.TX_CHANNEL] = Channel;
gEeprom.VfoChannel[gEeprom.TX_CHANNEL] = Channel;
gEeprom.ScreenChannel[gEeprom.TX_CHANNEL] = Channel;
}
gRequestSaveVFO = true;
g_2000039A = 2;

View File

@ -276,7 +276,7 @@ void MENU_AcceptSetting(void)
case MENU_MEM_CH:
gTxRadioInfo->CHANNEL_SAVE = gSubMenuSelection;
gRequestSaveChannel = 2;
gEeprom.EEPROM_0E81_0E84[0] = gSubMenuSelection;
gEeprom.MrChannel[0] = gSubMenuSelection;
return;
case MENU_SAVE:
@ -311,10 +311,10 @@ void MENU_AcceptSetting(void)
return;
case MENU_WX:
if (206 < gEeprom.VfoChannel[0]) {
if (206 < gEeprom.ScreenChannel[0]) {
return;
}
if (206 < gEeprom.VfoChannel[1]) {
if (206 < gEeprom.ScreenChannel[1]) {
return;
}
gEeprom.CROSS_BAND_RX_TX = gSubMenuSelection;
@ -631,7 +631,7 @@ void MENU_ShowCurrentSetting(void)
break;
case MENU_MEM_CH:
gSubMenuSelection = gEeprom.EEPROM_0E81_0E84[0];
gSubMenuSelection = gEeprom.MrChannel[0];
break;
case MENU_SAVE:
@ -767,7 +767,7 @@ void MENU_ShowCurrentSetting(void)
break;
case MENU_DEL_CH:
gSubMenuSelection = RADIO_FindNextChannel(gEeprom.EEPROM_0E81_0E84[0], 1, false, 1);
gSubMenuSelection = RADIO_FindNextChannel(gEeprom.MrChannel[0], 1, false, 1);
break;
case MENU_350TX:

34
board.c
View File

@ -429,35 +429,35 @@ void BOARD_EEPROM_Init(void)
// 0E80..0E87
EEPROM_ReadBuffer(0x0E80, Data, 8);
if (Data[0] < 0xd9) {
gEeprom.VfoChannel[0] = Data[0];
if (Data[0] < 217) {
gEeprom.ScreenChannel[0] = Data[0];
} else {
gEeprom.VfoChannel[0] = 205;
gEeprom.ScreenChannel[0] = 205;
}
if (Data[3] < 0xd9) {
gEeprom.VfoChannel[1] = Data[3];
if (Data[3] < 217) {
gEeprom.ScreenChannel[1] = Data[3];
} else {
gEeprom.VfoChannel[1] = 205;
gEeprom.ScreenChannel[1] = 205;
}
if (Data[1] < 200) {
gEeprom.EEPROM_0E81_0E84[0] = Data[1];
gEeprom.MrChannel[0] = Data[1];
} else {
gEeprom.EEPROM_0E81_0E84[0] = 0;
gEeprom.MrChannel[0] = 0;
}
if (Data[4] < 200) {
gEeprom.EEPROM_0E81_0E84[1] = Data[4];
gEeprom.MrChannel[1] = Data[4];
} else {
gEeprom.EEPROM_0E81_0E84[1] = 0;
gEeprom.MrChannel[1] = 0;
}
if (Data[2] - 200 < 7) {
gEeprom.EEPROM_0E82_0E85[0] = Data[2];
gEeprom.FreqChannel[0] = Data[2];
} else {
gEeprom.EEPROM_0E82_0E85[0] = 205;
gEeprom.FreqChannel[0] = 205;
}
if (Data[5] - 200 < 7) {
gEeprom.EEPROM_0E82_0E85[1] = Data[5];
gEeprom.FreqChannel[1] = Data[5];
} else {
gEeprom.EEPROM_0E82_0E85[1] = 205;
gEeprom.FreqChannel[1] = 205;
}
if (Data[6] - 207 < 10) {
gEeprom.NoaaChannel[0] = Data[6];
@ -743,12 +743,12 @@ void BOARD_EEPROM_Init(void)
}
if (gEeprom.VFO_OPEN == false) {
gEeprom.VfoChannel[0] = gEeprom.EEPROM_0E81_0E84[0];
gEeprom.VfoChannel[1] = gEeprom.EEPROM_0E81_0E84[1];
gEeprom.ScreenChannel[0] = gEeprom.MrChannel[0];
gEeprom.ScreenChannel[1] = gEeprom.MrChannel[1];
}
// 0D60..0E27
EEPROM_ReadBuffer(0x0D60, gMR_ChannelParameters, 207);
EEPROM_ReadBuffer(0x0D60, gMR_ChannelAttributes, 207);
// 0F30..0F3F
EEPROM_ReadBuffer(0x0F30, gCustomPasswordKey, 16);

34
gui.c
View File

@ -626,24 +626,24 @@ static void DisplayMain(void)
}
// 0x8F3C
if (gEeprom.VfoChannel[i] < 200) {
if (gEeprom.ScreenChannel[i] < 200) {
memcpy(pLine1 + 2, BITMAP_M, sizeof(BITMAP_M));
if (gNumberOffset == 0 || gEeprom.TX_CHANNEL != i) {
NUMBER_ToDigits(gEeprom.VfoChannel[i] + 1, String);
NUMBER_ToDigits(gEeprom.ScreenChannel[i] + 1, String);
} else {
memcpy(String + 5, gNumberForPrintf, 3);
}
GUI_DisplaySmallDigits(3, String + 5, 10, Line + 1);
} else if (gEeprom.VfoChannel[i] < 207) {
} else if (gEeprom.ScreenChannel[i] < 207) {
char c;
memcpy(pLine1 + 14, BITMAP_F, sizeof(BITMAP_F));
c = gEeprom.VfoChannel[i] - 199;
c = gEeprom.ScreenChannel[i] - 199;
GUI_DisplaySmallDigits(1, &c, 22, Line + 1);
} else {
memcpy(pLine1 + 7, BITMAP_NarrowBand, sizeof(BITMAP_NarrowBand));
if (gNumberOffset == 0 || gEeprom.TX_CHANNEL != i) {
NUMBER_ToDigits(gEeprom.VfoChannel[i] - 206, String);
NUMBER_ToDigits(gEeprom.ScreenChannel[i] - 206, String);
} else {
String[6] = gNumberForPrintf[0];
String[7] = gNumberForPrintf[1];
@ -692,12 +692,12 @@ static void DisplayMain(void)
}
GUI_PrintString(String, 31, 111, i * 4, Width, true);
} else {
if (gNumberOffset != 0 && (gEeprom.VfoChannel[i] - 200) < 7 && gEeprom.TX_CHANNEL == i) {
if (gNumberOffset != 0 && (gEeprom.ScreenChannel[i] - 200) < 7 && gEeprom.TX_CHANNEL == i) {
GUI_DisplayFrequency(gNumberForPrintf, 31, i * 4, true, false);
} else {
if (gEeprom.VfoChannel[i] < 200) {
if (gEeprom.ScreenChannel[i] < 200) {
if (gEeprom.CHANNEL_DISPLAY_MODE == 2 && (gEeprom.VfoInfo[i].Name[0] == 0 || gEeprom.VfoInfo[i].Name[0] == 0xFF)) {
sprintf(String, "CH-%03d", gEeprom.VfoChannel[i] + 1);
sprintf(String, "CH-%03d", gEeprom.ScreenChannel[i] + 1);
GUI_PrintString(String, 31, 112, i * 4, 8, true);
} else {
switch (gEeprom.CHANNEL_DISPLAY_MODE) {
@ -717,19 +717,19 @@ static void DisplayMain(void)
NUMBER_ToDigits(gEeprom.VfoInfo[i].pDCS_Current->Frequency, String);
}
GUI_DisplayFrequency(String, 31, i * 4, false, false);
if (gEeprom.VfoChannel[i] < 200) {
const uint8_t Params = gMR_ChannelParameters[gEeprom.VfoChannel[i]];
if (Params & MR_CH_SCANLIST1) {
if (gEeprom.ScreenChannel[i] < 200) {
const uint8_t Attributes = gMR_ChannelAttributes[gEeprom.ScreenChannel[i]];
if (Attributes & MR_CH_SCANLIST1) {
memcpy(pLine0 + 113, BITMAP_ScanList, sizeof(BITMAP_ScanList));
}
if (Params & MR_CH_SCANLIST2) {
if (Attributes & MR_CH_SCANLIST2) {
memcpy(pLine0 + 120, BITMAP_ScanList, sizeof(BITMAP_ScanList));
}
}
GUI_DisplaySmallDigits(2, String + 6, 112, Line + 1);
break;
case 1:
sprintf(String, "CH-%03d", gEeprom.VfoChannel[i] + 1);
sprintf(String, "CH-%03d", gEeprom.ScreenChannel[i] + 1);
GUI_PrintString(String, 31, 112, i * 4, 8, true);
break;
case 2:
@ -753,12 +753,12 @@ static void DisplayMain(void)
NUMBER_ToDigits(gEeprom.VfoInfo[i].pDCS_Current->Frequency, String);
}
GUI_DisplayFrequency(String, 31, i * 4, false, false);
if (gEeprom.VfoChannel[i] < 200) {
const uint8_t Params = gMR_ChannelParameters[gEeprom.VfoChannel[i]];
if (Params & MR_CH_SCANLIST1) {
if (gEeprom.ScreenChannel[i] < 200) {
const uint8_t Attributes = gMR_ChannelAttributes[gEeprom.ScreenChannel[i]];
if (Attributes & MR_CH_SCANLIST1) {
memcpy(pLine0 + 113, BITMAP_ScanList, sizeof(BITMAP_ScanList));
}
if (Params & MR_CH_SCANLIST2) {
if (Attributes & MR_CH_SCANLIST2) {
memcpy(pLine0 + 120, BITMAP_ScanList, sizeof(BITMAP_ScanList));
}
}

2
main.c
View File

@ -122,7 +122,7 @@ void Main(void)
GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_VOICE_0);
g_2000036F = 1;
AUDIO_SetVoiceID(0, VOICE_ID_WELCOME);
Channel = gEeprom.VfoChannel[gEeprom.TX_CHANNEL] + 1;
Channel = gEeprom.ScreenChannel[gEeprom.TX_CHANNEL] + 1;
if (Channel < 201) {
AUDIO_SetVoiceID(1, VOICE_ID_CHANNEL_MODE);
AUDIO_SetDigitVoice(2, Channel);

2
misc.c
View File

@ -43,7 +43,7 @@ uint16_t gEEPROM_RSSI_CALIB[3][4];
uint16_t gEEPROM_1F8A;
uint16_t gEEPROM_1F8C;
uint8_t gMR_ChannelParameters[207];
uint8_t gMR_ChannelAttributes[207];
volatile bool gNextTimeslice500ms;
volatile uint16_t g_2000032E;

2
misc.h
View File

@ -52,7 +52,7 @@ extern uint16_t gEEPROM_RSSI_CALIB[3][4];
extern uint16_t gEEPROM_1F8A;
extern uint16_t gEEPROM_1F8C;
extern uint8_t gMR_ChannelParameters[207];
extern uint8_t gMR_ChannelAttributes[207];
extern volatile bool gNextTimeslice500ms;
extern volatile uint16_t g_2000032E;

50
radio.c
View File

@ -40,7 +40,7 @@ uint8_t gCode;
bool RADIO_CheckValidChannel(uint8_t Channel, bool bCheckScanList, uint8_t VFO)
{
uint8_t Params;
uint8_t Attributes;
uint8_t PriorityCh1;
uint8_t PriorityCh2;
@ -49,20 +49,20 @@ bool RADIO_CheckValidChannel(uint8_t Channel, bool bCheckScanList, uint8_t VFO)
}
// Check channel is valid
Params = gMR_ChannelParameters[Channel];
if ((Params & MR_CH_BAND_MASK) > BAND7_470MHz) {
Attributes = gMR_ChannelAttributes[Channel];
if ((Attributes & MR_CH_BAND_MASK) > BAND7_470MHz) {
return false;
}
if (bCheckScanList) {
if (VFO == 0) {
if ((Params & MR_CH_SCANLIST1) == 0) {
if ((Attributes & MR_CH_SCANLIST1) == 0) {
return false;
}
PriorityCh1 = gEeprom.SCANLIST_PRIORITY_CH1[0];
PriorityCh2 = gEeprom.SCANLIST_PRIORITY_CH2[0];
} else if (VFO == 1) {
if ((Params & MR_CH_SCANLIST2) == 0) {
if ((Attributes & MR_CH_SCANLIST2) == 0) {
return false;
}
PriorityCh1 = gEeprom.SCANLIST_PRIORITY_CH1[1];
@ -123,7 +123,7 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
{
VFO_Info_t *pRadio;
uint8_t Channel;
uint8_t Params;
uint8_t Attributes;
uint8_t Band;
bool bParticipation2;
uint16_t Base;
@ -134,18 +134,18 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
pRadio = &gEeprom.VfoInfo[VFO];
if (!gSetting_350EN) {
if (gEeprom.EEPROM_0E82_0E85[VFO] == 204) {
gEeprom.EEPROM_0E82_0E85[VFO] = 205;
if (gEeprom.FreqChannel[VFO] == 204) {
gEeprom.FreqChannel[VFO] = 205;
}
if (gEeprom.VfoChannel[VFO] == 204) {
gEeprom.VfoChannel[VFO] = 205;
if (gEeprom.ScreenChannel[VFO] == 204) {
gEeprom.ScreenChannel[VFO] = 205;
}
}
Channel = gEeprom.VfoChannel[VFO];
Channel = gEeprom.ScreenChannel[VFO];
if (Channel < 217) {
if (Channel >= 207) {
RADIO_InitInfo(pRadio, gEeprom.VfoChannel[VFO], 2, NoaaFrequencyTable[Channel - 207]);
RADIO_InitInfo(pRadio, gEeprom.ScreenChannel[VFO], 2, NoaaFrequencyTable[Channel - 207]);
if (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) {
return;
}
@ -156,39 +156,39 @@ void RADIO_ConfigureChannel(uint8_t VFO, uint32_t Arg)
if (Channel < 200) {
Channel = RADIO_FindNextChannel(Channel, RADIO_CHANNEL_UP, false, VFO);
if (Channel == 0xFF) {
Channel = gEeprom.EEPROM_0E82_0E85[VFO];
gEeprom.VfoChannel[VFO] = gEeprom.EEPROM_0E82_0E85[VFO];
Channel = gEeprom.FreqChannel[VFO];
gEeprom.ScreenChannel[VFO] = gEeprom.FreqChannel[VFO];
} else {
gEeprom.VfoChannel[VFO] = Channel;
gEeprom.EEPROM_0E81_0E84[VFO] = Channel;
gEeprom.ScreenChannel[VFO] = Channel;
gEeprom.MrChannel[VFO] = Channel;
}
}
} else {
Channel = 205;
}
Params = gMR_ChannelParameters[Channel];
if (Params == 0xFF) {
Attributes = gMR_ChannelAttributes[Channel];
if (Attributes == 0xFF) {
uint8_t Index;
if (Channel < 200) {
Channel = gEeprom.EEPROM_0E82_0E85[VFO];
gEeprom.VfoChannel[VFO] = gEeprom.EEPROM_0E82_0E85[VFO];
Channel = gEeprom.FreqChannel[VFO];
gEeprom.ScreenChannel[VFO] = gEeprom.FreqChannel[VFO];
}
Index = Channel - 200;
RADIO_InitInfo(pRadio, Channel, Index, gLowerLimitFrequencyBandTable[Index]);
return;
}
Band = Params & MR_CH_BAND_MASK;
Band = Attributes & MR_CH_BAND_MASK;
if (Band > BAND7_470MHz) {
Band = BAND6_400MHz;
}
if (Channel < 200) {
gEeprom.VfoInfo[VFO].Band = Band;
gEeprom.VfoInfo[VFO].SCANLIST1_PARTICIPATION = !!(Params & MR_CH_SCANLIST1);
bParticipation2 = !!(Params & MR_CH_SCANLIST2);
gEeprom.VfoInfo[VFO].SCANLIST1_PARTICIPATION = !!(Attributes & MR_CH_SCANLIST1);
bParticipation2 = !!(Attributes & MR_CH_SCANLIST2);
} else {
Band = Channel - 200;
gEeprom.VfoInfo[VFO].Band = Band;
@ -602,8 +602,8 @@ void RADIO_ConfigureNOAA(void)
g_2000036F = 1;
if (gEeprom.NOAA_AUTO_SCAN) {
if (gEeprom.DUAL_WATCH != DUAL_WATCH_OFF) {
if (gEeprom.VfoChannel[0] < 207) {
if (gEeprom.VfoChannel[1] < 207) {
if (gEeprom.ScreenChannel[0] < 207) {
if (gEeprom.ScreenChannel[1] < 207) {
gIsNoaaMode = false;
return;
}

View File

@ -52,12 +52,12 @@ void SETTINGS_SaveVfoIndices(void)
UART_LogSend("sidx\r\n", 6);
State[0] = gEeprom.VfoChannel[0];
State[1] = gEeprom.EEPROM_0E81_0E84[0];
State[2] = gEeprom.EEPROM_0E82_0E85[0];
State[3] = gEeprom.VfoChannel[1];
State[4] = gEeprom.EEPROM_0E81_0E84[1];
State[5] = gEeprom.EEPROM_0E82_0E85[1];
State[0] = gEeprom.ScreenChannel[0];
State[1] = gEeprom.MrChannel[0];
State[2] = gEeprom.FreqChannel[0];
State[3] = gEeprom.ScreenChannel[1];
State[4] = gEeprom.MrChannel[1];
State[5] = gEeprom.FreqChannel[1];
State[6] = gEeprom.NoaaChannel[0];
State[7] = gEeprom.NoaaChannel[1];
@ -227,24 +227,24 @@ void SETTINGS_UpdateChannel(uint8_t Channel, const VFO_Info_t *pVFO, bool bUpdat
if (Channel < 207) {
uint8_t State[8];
uint16_t Offset;
uint8_t Params;
uint8_t Attributes;
Offset = 0x0D60 + (Channel & ~7U);
EEPROM_ReadBuffer(Offset, State, sizeof(State));
if (bUpdate) {
Params = 0
Attributes = 0
| (pVFO->SCANLIST1_PARTICIPATION << 7)
| (pVFO->SCANLIST2_PARTICIPATION << 6)
| (pVFO->Band << 0);
if (State[Channel & 7U] == Params) {
if (State[Channel & 7U] == Attributes) {
return;
}
} else {
Params = 0xFF;
Attributes = 0xFF;
}
State[Channel & 7U] = Params;
State[Channel & 7U] = Attributes;
EEPROM_WriteBuffer(Offset, State);
gMR_ChannelParameters[Channel] = Params;
gMR_ChannelAttributes[Channel] = Attributes;
}
}

View File

@ -91,9 +91,9 @@ enum ROGER_Mode_t {
typedef enum ROGER_Mode_t ROGER_Mode_t;
typedef struct {
uint8_t VfoChannel[2];
uint8_t EEPROM_0E82_0E85[2];
uint8_t EEPROM_0E81_0E84[2];
uint8_t ScreenChannel[2];
uint8_t FreqChannel[2];
uint8_t MrChannel[2];
uint8_t NoaaChannel[2];
uint8_t RX_CHANNEL;
uint8_t TX_CHANNEL;