Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Added differences from v2.01.31.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dual Tachyon authored and Dual Tachyon committed Sep 19, 2023
1 parent 0e0b92f commit a699a77
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
5 changes: 3 additions & 2 deletions audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,20 @@ 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) {
GPIO_ClearBit(&GPIOA->DATA, GPIOA_PIN_VOICE_1);
} 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);
}
}

Expand Down
21 changes: 20 additions & 1 deletion board.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}
}

6 changes: 6 additions & 0 deletions radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a699a77

Please sign in to comment.