0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 06:39:49 +03:00

Code clean ups + first part of channel squelch (not yet implemented)

This commit is contained in:
OneOfEleven
2023-10-19 19:00:57 +01:00
parent 75aa98cc06
commit 3bae9b5cdb
16 changed files with 245 additions and 244 deletions

View File

@ -549,7 +549,7 @@ void AIRCOPY_process_fsk_rx_10ms(void)
data[2] = false; // remove it
}
EEPROM_WriteBuffer(eeprom_addr, data); // 8 bytes at a time
EEPROM_WriteBuffer8(eeprom_addr, data); // 8 bytes at a time
data += write_size / sizeof(data[0]);
eeprom_addr += write_size;
}

View File

@ -115,7 +115,7 @@ void FM_EraseChannels(void)
memset(Template, 0xFF, sizeof(Template));
for (i = 0; i < 5; i++)
EEPROM_WriteBuffer(0x0E40 + (i * 8), Template);
EEPROM_WriteBuffer8(0x0E40 + (i * 8), Template);
memset(g_fm_channels, 0xFF, sizeof(g_fm_channels));
}

View File

@ -71,7 +71,7 @@
//
EEPROM_ReadBuffer(0x1F88, &misc, 8);
misc.BK4819_XtalFreqLow = value;
EEPROM_WriteBuffer(0x1F88, &misc);
EEPROM_WriteBuffer8(0x1F88, &misc);
}
}
#endif
@ -103,6 +103,7 @@ int MENU_GetLimits(uint8_t Cursor, int32_t *pMin, int32_t *pMax)
switch (Cursor)
{
case MENU_SQL:
case MENU_CHAN_SQL:
*pMin = 0;
*pMax = 9;
break;
@ -389,7 +390,12 @@ void MENU_AcceptSetting(void)
case MENU_SQL:
g_eeprom.squelch_level = g_sub_menu_selection;
g_vfo_configure_mode = VFO_CONFIGURE;
g_vfo_configure_mode = VFO_CONFIGURE;
break;
case MENU_CHAN_SQL:
g_tx_vfo->squelch_level = g_sub_menu_selection;
g_vfo_configure_mode = VFO_CONFIGURE;
break;
case MENU_STEP:
@ -855,12 +861,12 @@ void MENU_AcceptSetting(void)
g_battery_calibration[3] = g_sub_menu_selection; // 7.6V, ~29%, 3 bars above this value
g_battery_calibration[4] = (788ul * g_sub_menu_selection) / 760; // 7.88V, ~65%, 4 bars above this value
g_battery_calibration[5] = 2300;
EEPROM_WriteBuffer(0x1F40, g_battery_calibration);
EEPROM_WriteBuffer8(0x1F40, g_battery_calibration);
EEPROM_ReadBuffer( 0x1F48, buf, sizeof(buf));
buf[0] = g_battery_calibration[4];
buf[1] = g_battery_calibration[5];
EEPROM_WriteBuffer(0x1F48, buf);
EEPROM_WriteBuffer8(0x1F48, buf);
break;
}
@ -934,6 +940,10 @@ void MENU_ShowCurrentSetting(void)
g_sub_menu_selection = g_eeprom.squelch_level;
break;
case MENU_CHAN_SQL:
g_sub_menu_selection = g_tx_vfo->squelch_level;
break;
case MENU_STEP:
g_sub_menu_selection = FREQUENCY_get_step_index(STEP_FREQ_TABLE[g_tx_vfo->step_setting]);
break;

View File

@ -359,11 +359,11 @@ static void cmd_051D(const uint8_t *pBuffer)
#ifdef ENABLE_PWRON_PASSWORD
if ((Offset < 0x0E98 || Offset >= 0x0E9C) || !g_password_locked || pCmd->allow_password)
EEPROM_WriteBuffer(Offset, data);
EEPROM_WriteBuffer8(Offset, data);
#else
if (Offset == 0x0E98)
memset(data, 0xff, 4); // wipe the password
EEPROM_WriteBuffer(Offset, data);
EEPROM_WriteBuffer8(Offset, data);
#endif
}