From 944a4c965e86747998c7f3850c4099c29a450958 Mon Sep 17 00:00:00 2001 From: Dual Tachyon Date: Wed, 13 Sep 2023 10:02:31 +0100 Subject: [PATCH] Added differences from v2.01.31. --- audio.c | 5 +++-- board.c | 21 ++++++++++++++++++++- radio.c | 6 ++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/audio.c b/audio.c index c5590673..d5ec0365 100644 --- a/audio.c +++ b/audio.c @@ -164,7 +164,7 @@ void AUDIO_PlayVoice(uint8_t VoiceID) uint8_t i; GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_VOICE_0); - SYSTEM_DelayMs(7); + SYSTEM_DelayMs(20); GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_VOICE_0); for (i = 0; i < 8; i++) { if ((VoiceID & 0x80U) == 0) { @@ -172,11 +172,12 @@ void AUDIO_PlayVoice(uint8_t VoiceID) } else { GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_VOICE_1); } - SYSTICK_DelayUs(1200); + SYSTICK_DelayUs(1000); GPIO_SetBit(&GPIOA->DATA, GPIOA_PIN_VOICE_0); SYSTICK_DelayUs(1200); GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_VOICE_0); VoiceID <<= 1; + SYSTICK_DelayUs(200); } } diff --git a/board.c b/board.c index 053c5bce..9874f910 100644 --- a/board.c +++ b/board.c @@ -44,6 +44,14 @@ #include "sram-overlay.h" #endif +static const uint32_t gDefaultFrequencyTable[5] = { + 14502500, + 14552500, + 43477500, + 43502500, + 43697500, +}; + #if defined(ENABLE_OVERLAY) void BOARD_FLASH_Init(void) { @@ -582,7 +590,7 @@ void BOARD_EEPROM_Init(void) gEeprom.KEY_2_LONG_PRESS_ACTION = (Data[4] < 9) ? Data[4] : 6; gEeprom.SCAN_RESUME_MODE = (Data[5] < 3) ? Data[5] : SCAN_RESUME_CO; gEeprom.AUTO_KEYPAD_LOCK = (Data[6] < 2) ? Data[6] : true; - gEeprom.POWER_ON_DISPLAY_MODE = (Data[7] < 3) ? Data[7] : POWER_ON_DISPLAY_MODE_MESSAGE; + gEeprom.POWER_ON_DISPLAY_MODE = (Data[7] < 3) ? Data[7] : POWER_ON_DISPLAY_MODE_VOLTAGE; // 0E98..0E9F EEPROM_ReadBuffer(0x0E98, Data, 8); @@ -775,5 +783,16 @@ void BOARD_FactoryReset(bool bIsAll) EEPROM_WriteBuffer(i, Template); } } + if (bIsAll) { + RADIO_InitInfo(gRxVfo, FREQ_CHANNEL_FIRST + 5, 5, 41002500); + for (i = 0; i < 5; i++) { + const uint32_t Frequency = gDefaultFrequencyTable[i]; + + gRxVfo->ConfigRX.Frequency = Frequency; + gRxVfo->ConfigTX.Frequency = Frequency; + gRxVfo->Band = FREQUENCY_GetBand(Frequency); + SETTINGS_SaveChannel(MR_CHANNEL_FIRST + i, 0, gRxVfo, 2); + } + } } diff --git a/radio.c b/radio.c index b3f5d747..72a70c5d 100644 --- a/radio.c +++ b/radio.c @@ -126,6 +126,12 @@ void RADIO_InitInfo(VFO_Info_t *pInfo, uint8_t ChannelSave, uint8_t Band, uint32 pInfo->pRX = &pInfo->ConfigRX; pInfo->pTX = &pInfo->ConfigTX; pInfo->FREQUENCY_OF_DEVIATION = 1000000; + + if (ChannelSave == (FREQ_CHANNEL_FIRST + BAND2_108MHz)) { + pInfo->AM_CHANNEL_MODE = true; + pInfo->IsAM = true; + } + RADIO_ConfigureSquelchAndOutputPower(pInfo); }