diff --git a/main.c b/main.c index 1816cac..fb64429 100644 --- a/main.c +++ b/main.c @@ -184,6 +184,7 @@ void Main(void) AUDIO_SetVoiceID(1, VOICE_ID_ENG_FREQUENCY_MODE); } AUDIO_PlaySingleVoice(0); + RADIO_ConfigureNOAA(); } // Below this line is development/test area not conforming to the original firmware diff --git a/misc.c b/misc.c index 8fb7359..8443a28 100644 --- a/misc.c +++ b/misc.c @@ -88,6 +88,8 @@ uint8_t gCode; uint8_t gNumberOffset; uint8_t gNumberForPrintf[8]; +uint8_t gSystickFlag8; +uint8_t g_20000356; uint16_t g_200003B6; // diff --git a/misc.h b/misc.h index f6470c5..5e5211e 100644 --- a/misc.h +++ b/misc.h @@ -91,6 +91,8 @@ extern uint8_t gCode; extern uint8_t gNumberOffset; extern uint8_t gNumberForPrintf[8]; +extern uint8_t gSystickFlag8; +extern uint8_t g_20000356; extern uint16_t g_200003B6; // -------- diff --git a/radio.c b/radio.c index 487c187..cb9bde6 100644 --- a/radio.c +++ b/radio.c @@ -571,3 +571,35 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0) #endif } } + +void RADIO_ConfigureNOAA(void) +{ + uint8_t ChanAB; + + g_2000036F = 1; + if (gEeprom.NOAA_AUTO_SCAN) { + if (gEeprom.DUAL_WATCH != 0) { + if (gEeprom.EEPROM_0E80_0E83[0] < 207) { + if (gEeprom.EEPROM_0E80_0E83[1] < 207) { + gIsNoaaMode = false; + return; + } + ChanAB = 1; + } else { + ChanAB = 0; + } + if (gIsNoaaMode == false) { + gNoaaChannel = gEeprom.RadioInfo[ChanAB].CHANNEL_SAVE - 207; + } + gIsNoaaMode = true; + return; + } + if (gInfoCHAN_A->CHANNEL_SAVE >= 206) { + gIsNoaaMode = true; + gNoaaChannel = gInfoCHAN_A->CHANNEL_SAVE - 207; + g_20000356 = 0x32; + gSystickFlag8 = 0; + } + } +} + diff --git a/radio.h b/radio.h index 85c8695..95ecd87 100644 --- a/radio.h +++ b/radio.h @@ -87,6 +87,7 @@ void RADIO_ApplyOffset(RADIO_Info_t *pInfo); void RADIO_ConfigureTX(void); void RADIO_ConfigureCrossTX(void); void RADIO_SetupRegisters(bool bSwitchToFunction0); +void RADIO_ConfigureNOAA(void); #endif