mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 06:11:24 +03:00
fixed mdc1200 variable access
This commit is contained in:
parent
ef64d282e3
commit
cfbb5b0bbf
4
Makefile
4
Makefile
@ -21,7 +21,7 @@ ENABLE_AIRCOPY_RX_REBOOT := 0
|
||||
ENABLE_FMRADIO_64_76 := 0
|
||||
ENABLE_FMRADIO_76_90 := 0
|
||||
ENABLE_FMRADIO_76_108 := 0
|
||||
ENABLE_FMRADIO_875_108 := 1
|
||||
ENABLE_FMRADIO_875_108 := 0
|
||||
ENABLE_FMRADIO_64_108 := 0
|
||||
# NOAA 1.2 kB
|
||||
ENABLE_NOAA := 0
|
||||
@ -36,7 +36,7 @@ ENABLE_REDUCE_LOW_MID_TX_POWER := 1
|
||||
ENABLE_ALARM := 0
|
||||
ENABLE_TX1750 := 0
|
||||
# MDC1200 2.8 kB
|
||||
ENABLE_MDC1200 := 0
|
||||
ENABLE_MDC1200 := 1
|
||||
ENABLE_MDC1200_SHOW_OP_ARG := 1
|
||||
ENABLE_PWRON_PASSWORD := 0
|
||||
ENABLE_RESET_AES_KEY := 0
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -265,7 +265,7 @@ void FUNCTION_Select(function_type_t Function)
|
||||
if (!DTMF_Reply())
|
||||
{
|
||||
#ifdef ENABLE_MDC1200
|
||||
if (g_current_vfo->mdc1200_mode == MDC1200_MODE_BOT || g_current_vfo->mdc1200_mode == MDC1200_MODE_BOTH)
|
||||
if (g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOT || g_current_vfo->channel.mdc1200_mode == MDC1200_MODE_BOTH)
|
||||
{
|
||||
BK4819_WriteRegister(0x30,
|
||||
(1u << 15) | // enable VCO calibration
|
||||
|
20
settings.c
20
settings.c
@ -327,8 +327,10 @@ void SETTINGS_read_eeprom(void)
|
||||
// 0F48..0F4F
|
||||
g_eeprom.config.setting.scan_hold_time = (g_eeprom.config.setting.scan_hold_time > 40) ? 6 : (g_eeprom.config.setting.scan_hold_time < 2) ? 6 : g_eeprom.config.setting.scan_hold_time;
|
||||
|
||||
|
||||
// ****************************************
|
||||
// EEPROM cleaning
|
||||
|
||||
#if 1
|
||||
|
||||
memset(&g_eeprom.config.unused13, 0xff, sizeof(g_eeprom.config.unused13));
|
||||
|
||||
@ -345,7 +347,7 @@ void SETTINGS_read_eeprom(void)
|
||||
}
|
||||
else
|
||||
{ // used channel
|
||||
g_eeprom.config.channel_attributes[index].unused = 0;
|
||||
g_eeprom.config.channel_attributes[index].unused = 0x00;
|
||||
memset(g_eeprom.config.channel_name[index].unused, 0x00, sizeof(g_eeprom.config.channel_name[index].unused));
|
||||
}
|
||||
}
|
||||
@ -355,12 +357,14 @@ void SETTINGS_read_eeprom(void)
|
||||
g_eeprom.config.channel_attributes[200 + index].attributes = 0xC0 | index;
|
||||
|
||||
g_eeprom.config.channel_attributes[200 + 7].attributes = 0x00;
|
||||
|
||||
memcpy(&g_user_channel_attributes, &g_eeprom.config.channel_attributes, sizeof(g_user_channel_attributes));
|
||||
|
||||
SETTINGS_save_attributes();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
memcpy(&g_user_channel_attributes, &g_eeprom.config.channel_attributes, sizeof(g_user_channel_attributes));
|
||||
|
||||
// ****************************************
|
||||
|
||||
memset(&g_eeprom.calib.unused3, 0xff, sizeof(g_eeprom.calib.unused3));
|
||||
@ -575,21 +579,21 @@ void SETTINGS_save_chan_attribs_name(const unsigned int channel, const vfo_info_
|
||||
unsigned int SETTINGS_find_channel(const uint32_t frequency)
|
||||
{
|
||||
unsigned int chan;
|
||||
|
||||
|
||||
if (frequency == 0 || frequency == 0xffffffff)
|
||||
return 0xffffffff;
|
||||
|
||||
|
||||
for (chan = 0; chan <= USER_CHANNEL_LAST; chan++)
|
||||
{
|
||||
const uint32_t freq = g_eeprom.config.channel[chan].frequency;
|
||||
|
||||
if (g_user_channel_attributes[chan].band > BAND7_470MHz || freq == 0 || freq == 0xffffffff)
|
||||
continue;
|
||||
|
||||
|
||||
if (freq == frequency)
|
||||
return chan; // found it
|
||||
}
|
||||
|
||||
|
||||
return 0xffffffff;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user