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

Edited "D HOLD" times to include "STAY ON SCREEN" option

This commit is contained in:
OneOfEleven
2023-10-08 11:40:17 +01:00
parent 06c7d79b4b
commit 0547452589
24 changed files with 977 additions and 630 deletions

View File

@ -101,23 +101,27 @@ uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t T
uint32_t FREQUENCY_FloorToStep(uint32_t Upper, uint32_t Step, uint32_t Lower)
{
uint32_t Index;
if (Step == 833)
{
const uint32_t Delta = Upper - Lower;
uint32_t Base = (Delta / 2500) * 2500;
const uint32_t Index = ((Delta - Base) % 2500) / 833;
if (Index == 2)
Base++;
return Lower + Base + (Index * 833);
}
Index = (Upper - Lower) / Step;
return Lower + (Step * Index);
#if 1
uint32_t Index;
if (Step == 833)
{
const uint32_t Delta = Upper - Lower;
uint32_t Base = (Delta / 2500) * 2500;
const uint32_t Index = ((Delta - Base) % 2500) / 833;
if (Index == 2)
Base++;
return Lower + Base + (Index * 833);
}
Index = (Upper - Lower) / Step;
return Lower + (Step * Index);
#else
return Lower + (((Upper - Lower) / Step) * Step);
#endif
}
int TX_freq_check(const uint32_t Frequency)