0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 22:31:25 +03:00

bug fixes

This commit is contained in:
OneOfEleven 2023-11-29 20:25:45 +00:00
parent c21f4a7987
commit 40ebe60cee
4 changed files with 9 additions and 9 deletions

View File

@ -928,7 +928,7 @@ void MENU_AcceptSetting(void)
{ {
uint16_t index = (uint16_t)(((uint8_t *)&g_eeprom.calib.deviation_narrow) - ((uint8_t *)&g_eeprom)); uint16_t index = (uint16_t)(((uint8_t *)&g_eeprom.calib.deviation_narrow) - ((uint8_t *)&g_eeprom));
index &= ~7u; index &= ~7u;
EEPROM_WriteBuffer8(index, &g_eeprom.calib.deviation_narrow); EEPROM_WriteBuffer8(index, ((uint8_t *)&g_eeprom) + index);
} }
break; break;
@ -937,7 +937,7 @@ void MENU_AcceptSetting(void)
{ {
uint16_t index = (uint16_t)(((uint8_t *)&g_eeprom.calib.deviation_wide) - ((uint8_t *)&g_eeprom)); uint16_t index = (uint16_t)(((uint8_t *)&g_eeprom.calib.deviation_wide) - ((uint8_t *)&g_eeprom));
index &= ~7u; index &= ~7u;
EEPROM_WriteBuffer8(index, &g_eeprom.calib.deviation_wide); EEPROM_WriteBuffer8(index, ((uint8_t *)&g_eeprom) + index);
} }
break; break;
#endif #endif

Binary file not shown.

Binary file not shown.

View File

@ -56,7 +56,7 @@ void SETTINGS_write_eeprom_calib(void)
unsigned int index = (unsigned int)(((uint8_t *)&g_eeprom.calib) - ((uint8_t *)&g_eeprom)); unsigned int index = (unsigned int)(((uint8_t *)&g_eeprom.calib) - ((uint8_t *)&g_eeprom));
index &= ~7u; index &= ~7u;
for (i = 0; i < sizeof(g_eeprom.calib); i += 8) for (i = 0; i < sizeof(g_eeprom.calib); i += 8)
EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom.calib) + i); EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom) + index + i);
} }
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
@ -67,12 +67,12 @@ void SETTINGS_write_eeprom_calib(void)
index = (unsigned int)(((uint8_t *)&g_eeprom.config.setting.fm_radio) - ((uint8_t *)&g_eeprom)); index = (unsigned int)(((uint8_t *)&g_eeprom.config.setting.fm_radio) - ((uint8_t *)&g_eeprom));
index &= ~7u; index &= ~7u;
EEPROM_WriteBuffer8(index, &g_eeprom.config.setting.fm_radio); EEPROM_WriteBuffer8(index, ((uint8_t *)&g_eeprom) + index);
index = (unsigned int)(((uint8_t *)&g_eeprom.config.setting.fm_channel) - ((uint8_t *)&g_eeprom)); index = (unsigned int)(((uint8_t *)&g_eeprom.config.setting.fm_channel) - ((uint8_t *)&g_eeprom));
index &= ~7u; index &= ~7u;
for (i = 0; i < sizeof(g_eeprom.config.setting.fm_channel); i += 8) for (i = 0; i < sizeof(g_eeprom.config.setting.fm_channel); i += 8)
EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom.config.setting.fm_channel) + i); EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom) + index + i);
} }
#endif #endif
@ -80,7 +80,7 @@ void SETTINGS_save_vfo_indices(void)
{ {
uint16_t index = (uint16_t)(((uint8_t *)&g_eeprom.config.setting.indices) - ((uint8_t *)&g_eeprom)); uint16_t index = (uint16_t)(((uint8_t *)&g_eeprom.config.setting.indices) - ((uint8_t *)&g_eeprom));
index &= ~7u; index &= ~7u;
EEPROM_WriteBuffer8(index, &g_eeprom.config.setting.indices); EEPROM_WriteBuffer8(index, ((uint8_t *)&g_eeprom) + index);
} }
void SETTINGS_save_attributes(void) void SETTINGS_save_attributes(void)
@ -89,7 +89,7 @@ void SETTINGS_save_attributes(void)
unsigned int index = (unsigned int )(((uint8_t *)&g_eeprom.config.channel_attributes) - ((uint8_t *)&g_eeprom)); unsigned int index = (unsigned int )(((uint8_t *)&g_eeprom.config.channel_attributes) - ((uint8_t *)&g_eeprom));
index &= ~7u; index &= ~7u;
for (i = 0; i < sizeof(g_eeprom.config.channel_attributes); i += 8) for (i = 0; i < sizeof(g_eeprom.config.channel_attributes); i += 8)
EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom.config.channel_attributes) + i); EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom) + index + i);
} }
void SETTINGS_save_channel_names(void) void SETTINGS_save_channel_names(void)
@ -98,7 +98,7 @@ void SETTINGS_save_channel_names(void)
unsigned int index = (unsigned int)(((uint8_t *)&g_eeprom.config.channel_name) - ((uint8_t *)&g_eeprom)); unsigned int index = (unsigned int)(((uint8_t *)&g_eeprom.config.channel_name) - ((uint8_t *)&g_eeprom));
index &= ~7u; index &= ~7u;
for (i = 0; i < sizeof(g_eeprom.config.channel_name); i += 8) for (i = 0; i < sizeof(g_eeprom.config.channel_name); i += 8)
EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom.config.channel_name) + i); EEPROM_WriteBuffer8(index + i, ((uint8_t *)&g_eeprom) + index + i);
} }
void SETTINGS_read_eeprom(void) void SETTINGS_read_eeprom(void)
@ -469,7 +469,7 @@ void SETTINGS_save(void)
for (index = 0; index < sizeof(g_eeprom.config.setting); index += 8) for (index = 0; index < sizeof(g_eeprom.config.setting); index += 8)
{ {
const uint16_t offset = (uint16_t)(((uint8_t *)&g_eeprom.config.setting) - ((uint8_t *)&g_eeprom)); const uint16_t offset = (uint16_t)(((uint8_t *)&g_eeprom.config.setting) - ((uint8_t *)&g_eeprom));
EEPROM_WriteBuffer8(offset + index, ((uint8_t *)&g_eeprom.config.setting) + index); EEPROM_WriteBuffer8(offset + index, ((uint8_t *)&g_eeprom) + offset + index);
} }
} }