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

Fixed WX/Cross-band display indicator, some menu renames

This commit is contained in:
OneOfEleven
2023-09-12 16:53:47 +01:00
parent 4dfa882770
commit f436a84bd5
12 changed files with 190 additions and 134 deletions

View File

@ -217,11 +217,21 @@ void UI_DisplayFrequencySmall(const char *pDigits, uint8_t X, uint8_t Y, bool bD
}
}
void UI_DisplaySmallDigits(uint8_t Size, const char *pString, uint8_t X, uint8_t Y)
void UI_DisplaySmallDigits(const uint8_t size, const char *str, const uint8_t x, const uint8_t y, const bool display_leading_zeros)
{
const unsigned int char_width = 7;
unsigned int x = X;
bool display = display_leading_zeros;
unsigned int xx;
unsigned int i;
for (i = 0; i < Size; i++, x += char_width)
memcpy(gFrameBuffer[Y] + x, gFontSmallDigits[(unsigned int)pString[i]], char_width);
for (i = 0, xx = x; i < size; i++)
{
const unsigned int c = (unsigned int)str[i];
if (c > 0)
display = true;
if (display && c < ARRAY_SIZE(gFontSmallDigits))
{
memcpy(gFrameBuffer[y] + xx, gFontSmallDigits[c], char_width);
xx += char_width;
}
}
}