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

Fixed channel display new bug

This commit is contained in:
OneOfEleven
2023-09-10 10:28:30 +01:00
parent b1399c8073
commit 0176cb4214
10 changed files with 122 additions and 113 deletions

View File

@ -96,11 +96,11 @@ void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_
{
if (pString[i] >= 32)
{
const unsigned int Index = ((unsigned int)pString[i] - 32) * 5;
if (Index < sizeof(gFont5x7))
const unsigned int Index = ((unsigned int)pString[i] - 32);
if (Index < ARRAY_SIZE(gFont5x7))
{
const unsigned int ofs = (unsigned int)Start + (i * 8);
memcpy(gFrameBuffer[Line] + ofs, &gFont5x7[Index], 5);
const unsigned int ofs = (unsigned int)Start + (i * 6);
memcpy(gFrameBuffer[Line] + ofs, &gFont5x7[Index], ARRAY_SIZE(gFont5x7[Index]));
}
}
}
@ -114,8 +114,8 @@ void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_
const unsigned int Index = (unsigned int)pString[i] - 32;
if (Index < ARRAY_SIZE(gFont6x8))
{
const unsigned int ofs = (unsigned int)Start + (i * 8);
memcpy(gFrameBuffer[Line] + ofs, &gFont6x8[Index], 6);
const unsigned int ofs = (unsigned int)Start + (i * 7);
memcpy(gFrameBuffer[Line] + ofs, &gFont6x8[Index], ARRAY_SIZE(gFont6x8[Index]));
}
}
}