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

Frequency enter tidy up

This commit is contained in:
OneOfEleven
2023-09-28 10:17:45 +01:00
parent f55a2b6a6d
commit 86525941bc
5 changed files with 39 additions and 62 deletions

View File

@ -110,27 +110,11 @@ const uint32_t UpperLimitFrequencyBandTable[7] =
FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency)
{
// if (Frequency >= 60000000 && Frequency <= bx_max_Hz)
// return BAND7_470MHz;
if (Frequency >= 47000000)
return BAND7_470MHz;
if (Frequency >= 40000000)
return BAND6_400MHz;
if (Frequency >= 35000000)
return BAND5_350MHz;
if (Frequency >= 17400000)
return BAND4_174MHz;
if (Frequency >= 13600000)
return BAND3_136MHz;
if (Frequency >= 10800000)
return BAND2_108MHz;
if (Frequency >= 5000000)
return BAND1_50MHz;
// if (Frequency >= bx_min_Hz)
return BAND1_50MHz;
// TODO: Double check the assembly
// return BAND6_400MHz;
int band;
for (band = BAND7_470MHz; band >= BAND1_50MHz; band--)
if (Frequency >= LowerLimitFrequencyBandTable[band])
return band;
return BAND1_50MHz;
}
uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, int32_t LowerLimit, int32_t Middle, int32_t UpperLimit, int32_t Frequency)