diff --git a/radio/src/lcd_default.cpp b/radio/src/lcd_default.cpp index d03eaaf33..d15e16681 100755 --- a/radio/src/lcd_default.cpp +++ b/radio/src/lcd_default.cpp @@ -59,83 +59,81 @@ void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width inv = true; } - for (int8_t i=0; i0) { - b1 = b[j-1] >> (8-ym8); - } - else { - keep = ~(keepref << ym8); - } - if (j= 10) - b[j] &= 1 + (keepref << 1); - else - b[j] &= keepref; - } + const uint8_t ym8 = (y & 0x07); + const uint8_t keepref = (1 << ((height&0x07)+1)) - 1; + uint8_t * dest = p; + for (uint8_t j=0; j0) { + b1 = b[j-1] >> (8-ym8); } - b2 = b[j] << ym8; + else { + keep = ~(keepref << ym8); + } + if (j> (8-ym8)); + } + if (!blink) { + LCD_BYTE_FILTER(dest, keep, b1|b2); + } + dest += LCD_W; } - else { - keep = ~(keepref >> (8-ym8)); - } - if (!blink) { - LCD_BYTE_FILTER(dest, keep, b1|b2); - } - dest += LCD_W; } - } - if (inv && height<8) { - if (ym8) - lcd_mask(p, 0x01 << (ym8-1), FORCE); - else if (y) { - ASSERT_IN_DISPLAY(p - LCD_W); - lcd_mask(p - LCD_W, 0x80, FORCE); + if (inv && height<8) { + if (ym8) { + lcd_mask(p, 0x01 << (ym8-1), FORCE); + } + else if (y) { + ASSERT_IN_DISPLAY(p - LCD_W); + lcd_mask(p - LCD_W, 0x80, FORCE); + } } } @@ -393,7 +391,7 @@ void lcd_vlineStip(xcoord_t x, int8_t y, int8_t h, uint8_t pat, LcdFlags att) lcd_mask(p, msk & pat, att); p += LCD_W; } - while (h>0) { + while (h>=8) { ASSERT_IN_DISPLAY(p); lcd_mask(p, pat, att); p += LCD_W; diff --git a/radio/src/lcd_taranis.cpp b/radio/src/lcd_taranis.cpp index 7e4eaaae5..143109da6 100755 --- a/radio/src/lcd_taranis.cpp +++ b/radio/src/lcd_taranis.cpp @@ -65,6 +65,7 @@ void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width continue; } else { + // we need to work on the previous x when INVERS x--; } } diff --git a/radio/src/tests/gtests.cpp b/radio/src/tests/gtests.cpp index d78fe3529..2371b9be9 100644 --- a/radio/src/tests/gtests.cpp +++ b/radio/src/tests/gtests.cpp @@ -151,6 +151,7 @@ TEST(outdezNAtt, test_unsigned) EXPECT_EQ(memcmp(refBuf, displayBuf, sizeof(displayBuf)), 0) << "Unsigned numbers will be bad displayed"; } +#if !defined(PCBSKY9X) TEST(EEPROM, 100_random_writes) { eepromFile = NULL; // in memory @@ -275,6 +276,7 @@ TEST(EEPROM, rm) } EXPECT_EQ(sz, 0); } +#endif #if defined(FRSKY) && !defined(FRSKY_SPORT) extern void frskyDProcessPacket(uint8_t *packet); @@ -393,7 +395,7 @@ TEST(getSwitch, nullSW) EXPECT_EQ(getSwitch(0), true); } -#if !defined(PCBTARANIS) +#if !defined(CPUARM) TEST(getSwitch, recursiveSW) { MODEL_RESET(); @@ -784,7 +786,7 @@ TEST(Mixer, SlowDisabledOnStartup) EXPECT_EQ(chans[0], CHANNEL_MAX); } -#if !defined(PCBTARANIS) +#if !defined(CPUARM) TEST(Mixer, SlowAndDelayOnReplace3POSSource) { MODEL_RESET(); @@ -1048,6 +1050,13 @@ TEST(Lcd, Invers_0_0) EXPECT_TRUE(checkScreenshot("invers_0_0")); } +TEST(Lcd, Invers_0_1) +{ + lcd_clear(); + lcd_putsAtt(0, 1, "Test", INVERS); + EXPECT_TRUE(checkScreenshot("invers_0_1")); +} + TEST(Lcd, Prec2_Left) { lcd_clear(); @@ -1062,6 +1071,13 @@ TEST(Lcd, Prec2_Right) EXPECT_TRUE(checkScreenshot("prec2_right")); } +TEST(Lcd, Prec1_Dblsize_Invers) +{ + lcd_clear(); + lcd_outdezAtt(LCD_W, 10, 51, PREC1|DBLSIZE|INVERS); + EXPECT_TRUE(checkScreenshot("prec1_dblsize_invers")); +} + TEST(Lcd, Line_Wrap) { lcd_clear(); @@ -1078,6 +1094,15 @@ TEST(Lcd, Smlsize_putsStrIdx) } #endif +TEST(Lcd, vline) +{ + lcd_clear(); + for (int x=0; x<100; x+=2) { + lcd_vline(x, x/2, 12); + } + EXPECT_TRUE(checkScreenshot("vline")); +} + int main(int argc, char **argv) { QCoreApplication app(argc, argv); diff --git a/radio/src/tests/invers_0_1_128x64.png b/radio/src/tests/invers_0_1_128x64.png new file mode 100755 index 000000000..c831a5236 Binary files /dev/null and b/radio/src/tests/invers_0_1_128x64.png differ diff --git a/radio/src/tests/invers_0_1_212x64.png b/radio/src/tests/invers_0_1_212x64.png new file mode 100755 index 000000000..2e014fd35 Binary files /dev/null and b/radio/src/tests/invers_0_1_212x64.png differ diff --git a/radio/src/tests/prec1_dblsize_invers_128x64.png b/radio/src/tests/prec1_dblsize_invers_128x64.png new file mode 100755 index 000000000..b5969f325 Binary files /dev/null and b/radio/src/tests/prec1_dblsize_invers_128x64.png differ diff --git a/radio/src/tests/prec1_dblsize_invers_212x64.png b/radio/src/tests/prec1_dblsize_invers_212x64.png new file mode 100755 index 000000000..ae5a69b31 Binary files /dev/null and b/radio/src/tests/prec1_dblsize_invers_212x64.png differ diff --git a/radio/src/tests/smlsize_putsstridx_128x64.png b/radio/src/tests/smlsize_putsstridx_128x64.png new file mode 100755 index 000000000..5caf95f3a Binary files /dev/null and b/radio/src/tests/smlsize_putsstridx_128x64.png differ diff --git a/radio/src/tests/vline_128x64.png b/radio/src/tests/vline_128x64.png new file mode 100755 index 000000000..6cd120f84 Binary files /dev/null and b/radio/src/tests/vline_128x64.png differ diff --git a/radio/src/tests/vline_212x64.png b/radio/src/tests/vline_212x64.png new file mode 100755 index 000000000..fb5fba882 Binary files /dev/null and b/radio/src/tests/vline_212x64.png differ