mirror of
https://github.com/kamilsss655/uv-k5-firmware-custom
synced 2024-11-22 19:18:56 +00:00
Added AM note
This commit is contained in:
parent
9fac4a780a
commit
2f2bdcb4b8
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
26
ui/helper.c
26
ui/helper.c
@ -72,15 +72,17 @@ void UI_GenerateChannelStringEx(char *pString, bool bShowPrefix, uint8_t Channel
|
|||||||
|
|
||||||
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width, bool bCentered)
|
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width, bool bCentered)
|
||||||
{
|
{
|
||||||
uint32_t i, Length;
|
size_t i;
|
||||||
|
size_t Length = strlen(pString);
|
||||||
|
|
||||||
Length = strlen(pString);
|
if (bCentered)
|
||||||
if (bCentered) {
|
|
||||||
Start += (((End - Start) - (Length * Width)) + 1) / 2;
|
Start += (((End - Start) - (Length * Width)) + 1) / 2;
|
||||||
}
|
|
||||||
for (i = 0; i < Length; i++) {
|
for (i = 0; i < Length; i++)
|
||||||
if (pString[i] >= ' ' && pString[i] < 0x7F) {
|
{
|
||||||
uint8_t Index = pString[i] - ' ';
|
if (pString[i] >= ' ' && pString[i] < 127)
|
||||||
|
{
|
||||||
|
const uint8_t Index = pString[i] - ' ';
|
||||||
memcpy(gFrameBuffer[Line + 0] + (i * Width) + Start, &gFontBig[Index][0], 8);
|
memcpy(gFrameBuffer[Line + 0] + (i * Width) + Start, &gFontBig[Index][0], 8);
|
||||||
memcpy(gFrameBuffer[Line + 1] + (i * Width) + Start, &gFontBig[Index][8], 8);
|
memcpy(gFrameBuffer[Line + 1] + (i * Width) + Start, &gFontBig[Index][8], 8);
|
||||||
}
|
}
|
||||||
@ -114,9 +116,9 @@ void UI_DisplayFrequency(const char *pDigits, uint8_t X, uint8_t Y, bool bDispla
|
|||||||
pFb1[0x28] = 0x60;
|
pFb1[0x28] = 0x60;
|
||||||
pFb1[0x29] = 0x60;
|
pFb1[0x29] = 0x60;
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
const uint8_t Digit = pDigits[i + 3];
|
const uint8_t Digit = pDigits[i + 3];
|
||||||
|
|
||||||
memcpy(pFb0 + (i * 13) + 42, gFontBigDigits[Digit] + 0, 13);
|
memcpy(pFb0 + (i * 13) + 42, gFontBigDigits[Digit] + 0, 13);
|
||||||
memcpy(pFb1 + (i * 13) + 42, gFontBigDigits[Digit] + 13, 13);
|
memcpy(pFb1 + (i * 13) + 42, gFontBigDigits[Digit] + 13, 13);
|
||||||
}
|
}
|
||||||
@ -124,10 +126,8 @@ void UI_DisplayFrequency(const char *pDigits, uint8_t X, uint8_t Y, bool bDispla
|
|||||||
|
|
||||||
void UI_DisplaySmallDigits(uint8_t Size, const char *pString, uint8_t X, uint8_t Y)
|
void UI_DisplaySmallDigits(uint8_t Size, const char *pString, uint8_t X, uint8_t Y)
|
||||||
{
|
{
|
||||||
uint8_t i;
|
unsigned int i;
|
||||||
|
for (i = 0; i < Size; i++)
|
||||||
for (i = 0; i < Size; i++) {
|
|
||||||
memcpy(gFrameBuffer[Y] + (i * 7) + X, gFontSmallDigits[(uint8_t)pString[i]], 7);
|
memcpy(gFrameBuffer[Y] + (i * 7) + X, gFontSmallDigits[(uint8_t)pString[i]], 7);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
ui/menu.c
16
ui/menu.c
@ -512,8 +512,20 @@ void UI_DisplayMenu(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
UI_PrintString(String, 50, 127, 2, 8, true);
|
if (gMenuCursor == MENU_AM)
|
||||||
|
{ // the radio doesn't really do AM
|
||||||
|
UI_PrintString(String, 50, 127, 1, 8, true);
|
||||||
|
if (gSubMenuSelection > 0)
|
||||||
|
{
|
||||||
|
UI_PrintString("not", 50, 127, 3, 8, true);
|
||||||
|
UI_PrintString("really", 50, 127, 5, 8, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UI_PrintString(String, 50, 127, 2, 8, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (gMenuCursor == MENU_VOL)
|
if (gMenuCursor == MENU_VOL)
|
||||||
{ // 2nd text line .. percentage
|
{ // 2nd text line .. percentage
|
||||||
const uint16_t volts = (gBatteryVoltageAverage < gMin_bat_v) ? gMin_bat_v :
|
const uint16_t volts = (gBatteryVoltageAverage < gMin_bat_v) ? gMin_bat_v :
|
||||||
|
Loading…
Reference in New Issue
Block a user