0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-20 15:08:37 +03:00

updated MDC1200

This commit is contained in:
OneOfEleven
2023-10-28 08:46:27 +01:00
parent 25fee556c6
commit 2e0b431fd4
16 changed files with 381 additions and 308 deletions

29
radio.c
View File

@ -366,24 +366,13 @@ void RADIO_configure_channel(const unsigned int VFO, const unsigned int configur
p_vfo->tx_offset_freq = FREQUENCY_floor_to_step(p_vfo->tx_offset_freq + (p_vfo->step_freq / 2), p_vfo->step_freq, 0, p_vfo->tx_offset_freq + p_vfo->step_freq);
}
RADIO_ApplyOffset(p_vfo);
RADIO_ApplyOffset(p_vfo, true);
// channel name
memset(p_vfo->name, 0, sizeof(p_vfo->name));
if (Channel <= USER_CHANNEL_LAST)
EEPROM_ReadBuffer(0x0F50 + (Channel * 16), p_vfo->name, 10); // only 10 bytes used
if (!p_vfo->frequency_reverse)
{
p_vfo->p_rx = &p_vfo->freq_config_rx;
p_vfo->p_tx = &p_vfo->freq_config_tx;
}
else
{
p_vfo->p_rx = &p_vfo->freq_config_tx;
p_vfo->p_tx = &p_vfo->freq_config_rx;
}
if (p_vfo->am_mode)
{ // freq/chan is in AM mode
// disable stuff, even though it can all still be used with AM ???
@ -583,7 +572,7 @@ void RADIO_ConfigureSquelchAndOutputPower(vfo_info_t *p_vfo)
// *******************************
}
void RADIO_ApplyOffset(vfo_info_t *p_vfo)
void RADIO_ApplyOffset(vfo_info_t *p_vfo, const bool set_pees)
{
uint32_t Frequency = p_vfo->freq_config_rx.frequency;
@ -606,6 +595,20 @@ void RADIO_ApplyOffset(vfo_info_t *p_vfo)
Frequency = FREQ_BAND_TABLE[ARRAY_SIZE(FREQ_BAND_TABLE) - 1].upper;
p_vfo->freq_config_tx.frequency = Frequency;
if (set_pees)
{
if (!p_vfo->frequency_reverse)
{
p_vfo->p_rx = &p_vfo->freq_config_rx;
p_vfo->p_tx = &p_vfo->freq_config_tx;
}
else
{
p_vfo->p_rx = &p_vfo->freq_config_tx;
p_vfo->p_tx = &p_vfo->freq_config_rx;
}
}
}
static void RADIO_SelectCurrentVfo(void)