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

Added freq cal menu option (hidden) + 8.33kHz step bug fix

This commit is contained in:
OneOfEleven
2023-09-15 21:58:59 +01:00
parent 43b9c0944a
commit eb7dcceaab
16 changed files with 233 additions and 113 deletions

7
misc.c
View File

@ -216,12 +216,15 @@ void NUMBER_ToDigits(uint32_t Value, char *pDigits)
pDigits[8] = 0;
}
uint8_t NUMBER_AddWithWraparound(uint8_t Base, int8_t Add, uint8_t LowerLimit, uint8_t UpperLimit)
int32_t NUMBER_AddWithWraparound(int32_t Base, int32_t Add, int32_t LowerLimit, int32_t UpperLimit)
{
Base += Add;
if (Base == 0xFF || Base < LowerLimit)
if (Base == 0x7fffffff || Base < LowerLimit)
return UpperLimit;
if (Base > UpperLimit)
return LowerLimit;
return Base;
}