mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-19 22:58:04 +03:00
fix dual watch bug + other stuff
This commit is contained in:
39
app/uart.c
39
app/uart.c
@ -210,7 +210,7 @@ static void SendVersion(void)
|
||||
reply.Header.ID = 0x0515;
|
||||
reply.Header.Size = sizeof(reply.Data);
|
||||
memcpy(reply.Data.Version, Version_str, slen);
|
||||
reply.Data.has_custom_aes_key = g_has_custom_aes_key;
|
||||
reply.Data.has_custom_aes_key = g_has_aes_key;
|
||||
reply.Data.password_locked = g_password_locked;
|
||||
reply.Data.Challenge[0] = g_challenge[0];
|
||||
reply.Data.Challenge[1] = g_challenge[1];
|
||||
@ -285,11 +285,12 @@ static void cmd_051B(const uint8_t *pBuffer)
|
||||
reply.Data.Offset = addr;
|
||||
reply.Data.Size = size;
|
||||
|
||||
// if (g_has_custom_aes_key)
|
||||
// if (g_has_aes_key)
|
||||
// locked = is_locked;
|
||||
|
||||
// if (!locked)
|
||||
EEPROM_ReadBuffer(addr, reply.Data.Data, size);
|
||||
// EEPROM_ReadBuffer(addr, reply.Data.Data, size);
|
||||
memcpy(reply.Data.Data, ((uint8_t *)&g_eeprom) + addr, size);
|
||||
|
||||
SendReply(&reply, size + 8);
|
||||
}
|
||||
@ -303,7 +304,7 @@ static void cmd_051D(const uint8_t *pBuffer)
|
||||
unsigned int size = pCmd->Size;
|
||||
#ifdef INCLUDE_AES
|
||||
bool reload_eeprom = false;
|
||||
bool locked = g_has_custom_aes_key ? is_locked : g_has_custom_aes_key;
|
||||
bool locked = g_has_aes_key ? is_locked : g_has_aes_key;
|
||||
#endif
|
||||
reply_051D_t reply;
|
||||
|
||||
@ -369,7 +370,7 @@ static void cmd_051D(const uint8_t *pBuffer)
|
||||
|
||||
#ifdef INCLUDE_AES
|
||||
if (reload_eeprom)
|
||||
BOARD_eeprom_load();
|
||||
SETTINGS_read_eeprom();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -412,7 +413,7 @@ static void cmd_0529(void)
|
||||
static void cmd_052D(const uint8_t *pBuffer)
|
||||
{
|
||||
cmd_052D_t *pCmd = (cmd_052D_t *)pBuffer;
|
||||
bool locked = g_has_custom_aes_key;
|
||||
bool locked = g_has_aes_key;
|
||||
uint32_t response[4];
|
||||
reply_052D_t reply;
|
||||
|
||||
@ -420,8 +421,10 @@ static void cmd_052D(const uint8_t *pBuffer)
|
||||
|
||||
if (!locked)
|
||||
{
|
||||
uint32_t aes_key[4];
|
||||
memcpy((void *)&response, &pCmd->Response, sizeof(response)); // overcome strict compiler warning settings
|
||||
locked = IsBadChallenge(g_custom_aes_key, g_challenge, response);
|
||||
memcpy(aes_key, g_eeprom.config.setting.aes_key, sizeof(aes_key));
|
||||
locked = IsBadChallenge(aes_key, g_challenge, response);
|
||||
}
|
||||
|
||||
if (!locked)
|
||||
@ -459,21 +462,21 @@ static void cmd_052F(const uint8_t *pBuffer)
|
||||
{
|
||||
const cmd_052F_t *pCmd = (const cmd_052F_t *)pBuffer;
|
||||
|
||||
g_eeprom.dual_watch = DUAL_WATCH_OFF;
|
||||
g_eeprom.cross_vfo_rx_tx = CROSS_BAND_OFF;
|
||||
g_eeprom.rx_vfo = 0;
|
||||
g_eeprom.dtmf_side_tone = false;
|
||||
g_eeprom.vfo_info[0].frequency_reverse = false;
|
||||
g_eeprom.vfo_info[0].p_rx = &g_eeprom.vfo_info[0].freq_config_rx;
|
||||
g_eeprom.vfo_info[0].p_tx = &g_eeprom.vfo_info[0].freq_config_tx;
|
||||
g_eeprom.vfo_info[0].tx_offset_freq_dir = TX_OFFSET_FREQ_DIR_OFF;
|
||||
g_eeprom.vfo_info[0].dtmf_ptt_id_tx_mode = PTT_ID_OFF;
|
||||
g_eeprom.vfo_info[0].dtmf_decoding_enable = false;
|
||||
g_rx_vfo = 0;
|
||||
g_eeprom.config.setting.dual_watch = DUAL_WATCH_OFF;
|
||||
g_eeprom.config.setting.cross_vfo = CROSS_BAND_OFF;
|
||||
g_eeprom.config.setting.dtmf.side_tone = false;
|
||||
g_vfo_info[0].frequency_reverse = false;
|
||||
g_vfo_info[0].p_rx = &g_vfo_info[0].freq_config_rx;
|
||||
g_vfo_info[0].p_tx = &g_vfo_info[0].freq_config_tx;
|
||||
g_vfo_info[0].tx_offset_freq_dir = TX_OFFSET_FREQ_DIR_OFF;
|
||||
g_vfo_info[0].dtmf_ptt_id_tx_mode = PTT_ID_OFF;
|
||||
g_vfo_info[0].dtmf_decoding_enable = false;
|
||||
|
||||
g_serial_config_tick_500ms = serial_config_tick_500ms;
|
||||
|
||||
#ifdef ENABLE_NOAA
|
||||
g_is_noaa_mode = false;
|
||||
g_noaa_mode = false;
|
||||
#endif
|
||||
|
||||
if (g_current_function == FUNCTION_POWER_SAVE)
|
||||
|
Reference in New Issue
Block a user