Added differences from v2.01.31.

This commit is contained in:
Dual Tachyon 2023-09-13 10:02:31 +01:00
parent 6f8afac886
commit 9b7ee2ffff
3 changed files with 29 additions and 3 deletions

View File

@ -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);
}
}

21
board.c
View File

@ -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);
}
}
}

View File

@ -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);
}