mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 00:05:17 +03:00
Fixes #1585
This commit is contained in:
parent
3f3708f0f1
commit
a92de216ac
3 changed files with 26 additions and 11 deletions
|
@ -134,11 +134,7 @@ void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width
|
||||||
|
|
||||||
void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
||||||
{
|
{
|
||||||
#if !defined(BOOT)
|
const pm_uchar * q;
|
||||||
const pm_uchar *q = (c < 0xC0) ? &font_5x7[(c-0x20)*5] : &font_5x7_extra[(c-0xC0)*5];
|
|
||||||
#else
|
|
||||||
const pm_uchar *q = &font_5x7[(c-0x20)*5];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
lcdNextPos = x-1;
|
lcdNextPos = x-1;
|
||||||
|
|
||||||
|
@ -158,14 +154,17 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
||||||
c_remapped = 4;
|
c_remapped = 4;
|
||||||
else if (c!=' ')
|
else if (c!=' ')
|
||||||
flags &= ~BOLD;
|
flags &= ~BOLD;
|
||||||
if ((c>= 128) && (flags & DBLSIZE))
|
|
||||||
c_remapped = c - 60;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & DBLSIZE) {
|
if (flags & DBLSIZE) {
|
||||||
/* each letter consists of ten top bytes followed by
|
if (c >= 0xC0) {
|
||||||
* by ten bottom bytes (20 bytes per * char) */
|
q = &font_10x14_extra[((uint16_t)(c-0xC0))*20];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (c >= 128)
|
||||||
|
c_remapped = c - 60;
|
||||||
q = &font_10x14[((uint16_t)c_remapped)*20];
|
q = &font_10x14[((uint16_t)c_remapped)*20];
|
||||||
|
}
|
||||||
lcdPutPattern(x, y, q, 10, 16, flags);
|
lcdPutPattern(x, y, q, 10, 16, flags);
|
||||||
}
|
}
|
||||||
else if (flags & XXLSIZE) {
|
else if (flags & XXLSIZE) {
|
||||||
|
@ -193,6 +192,11 @@ void lcd_putcAtt(xcoord_t x, uint8_t y, const unsigned char c, LcdFlags flags)
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
#if !defined(BOOT)
|
||||||
|
q = (c < 0xC0) ? &font_5x7[(c-0x20)*5] : &font_5x7_extra[(c-0xC0)*5];
|
||||||
|
#else
|
||||||
|
q = &font_5x7[(c-0x20)*5];
|
||||||
|
#endif
|
||||||
lcdPutPattern(x, y, q, 5, 7, flags);
|
lcdPutPattern(x, y, q, 5, 7, flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
radio/src/tests/drawswitch_212x64.png
Executable file
BIN
radio/src/tests/drawswitch_212x64.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 544 B |
|
@ -242,5 +242,16 @@ TEST(Lcd, Dblsize)
|
||||||
lcd_putsAtt(82, 10, "TST", DBLSIZE);
|
lcd_putsAtt(82, 10, "TST", DBLSIZE);
|
||||||
EXPECT_TRUE(checkScreenshot("dblsize"));
|
EXPECT_TRUE(checkScreenshot("dblsize"));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(PCBTARANIS)
|
||||||
|
TEST(Lcd, DrawSwitch)
|
||||||
|
{
|
||||||
|
lcd_clear();
|
||||||
|
putsSwitches(0, 10, SWSRC_SA0, 0);
|
||||||
|
putsSwitches(30, 10, SWSRC_SA0, SMLSIZE);
|
||||||
|
// putsSwitches(60, 10, SWSRC_SA0, MIDSIZE); missing arrows in this font
|
||||||
|
putsSwitches(90, 10, SWSRC_SA0, DBLSIZE);
|
||||||
|
EXPECT_TRUE(checkScreenshot("drawswitch"));
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue