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

FM radio tidy up

This commit is contained in:
OneOfEleven
2023-10-11 18:32:10 +01:00
parent d676c77e85
commit 8c21a0e543
8 changed files with 72 additions and 63 deletions

View File

@ -192,8 +192,6 @@ int FM_CheckFrequencyLock(uint16_t Frequency, uint16_t LowerLimit)
//if (Deviation > -281 && Deviation < 280)
if (Deviation < 280 || Deviation > 3815)
{
// not BLE(less than or equal)
if (Frequency > LowerLimit && (Frequency - BK1080_BaseFrequency) == 1)
{
if (BK1080_FrequencyDeviation & 0x800)
@ -203,8 +201,6 @@ int FM_CheckFrequencyLock(uint16_t Frequency, uint16_t LowerLimit)
goto Bail;
}
// not BLT(less than)
if (Frequency >= LowerLimit && (BK1080_BaseFrequency - Frequency) == 1)
{
if ((BK1080_FrequencyDeviation & 0x800) == 0)
@ -285,9 +281,11 @@ static void FM_Key_DIGITS(key_code_t Key, bool key_pressed, bool key_held)
uint32_t Frequency;
g_input_box_index = 0;
NUMBER_Get(g_input_box, &Frequency);
Frequency /= 10000;
if (Frequency < g_eeprom.fm_lower_limit || g_eeprom.fm_upper_limit < Frequency)
{
g_request_display_screen = DISPLAY_FM;