Display problems on Sky9x

This commit is contained in:
bsongis
2014-07-05 15:37:49 +02:00
parent c184ddd996
commit be6f1587ed
10 changed files with 95 additions and 71 deletions
+7 -9
View File
@@ -59,9 +59,11 @@ void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width
inv = true; inv = true;
} }
for (int8_t i=0; i<width+2 && p<end; i++) {
uint8_t lines = (height+7)/8; uint8_t lines = (height+7)/8;
assert(lines <= 5); assert(lines <= 5);
for (int8_t i=0; i<width+2; i++) {
if (p<end) {
uint8_t b[5] = { 0 }; uint8_t b[5] = { 0 };
if (i==0) { if (i==0) {
if (x==0 || !inv) { if (x==0 || !inv) {
@@ -111,12 +113,6 @@ void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width
if (j<lines) { if (j<lines) {
if (inv) { if (inv) {
b[j] = ~b[j]; b[j] = ~b[j];
if (j==lines-1) {
if (height >= 10)
b[j] &= 1 + (keepref << 1);
else
b[j] &= keepref;
}
} }
b2 = b[j] << ym8; b2 = b[j] << ym8;
} }
@@ -131,13 +127,15 @@ void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width
} }
if (inv && height<8) { if (inv && height<8) {
if (ym8) if (ym8) {
lcd_mask(p, 0x01 << (ym8-1), FORCE); lcd_mask(p, 0x01 << (ym8-1), FORCE);
}
else if (y) { else if (y) {
ASSERT_IN_DISPLAY(p - LCD_W); ASSERT_IN_DISPLAY(p - LCD_W);
lcd_mask(p - LCD_W, 0x80, FORCE); lcd_mask(p - LCD_W, 0x80, FORCE);
} }
} }
}
p++; p++;
lcdNextPos++; lcdNextPos++;
@@ -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); lcd_mask(p, msk & pat, att);
p += LCD_W; p += LCD_W;
} }
while (h>0) { while (h>=8) {
ASSERT_IN_DISPLAY(p); ASSERT_IN_DISPLAY(p);
lcd_mask(p, pat, att); lcd_mask(p, pat, att);
p += LCD_W; p += LCD_W;
+1
View File
@@ -65,6 +65,7 @@ void lcdPutPattern(xcoord_t x, uint8_t y, const uint8_t * pattern, uint8_t width
continue; continue;
} }
else { else {
// we need to work on the previous x when INVERS
x--; x--;
} }
} }
+27 -2
View File
@@ -151,6 +151,7 @@ TEST(outdezNAtt, test_unsigned)
EXPECT_EQ(memcmp(refBuf, displayBuf, sizeof(displayBuf)), 0) << "Unsigned numbers will be bad displayed"; EXPECT_EQ(memcmp(refBuf, displayBuf, sizeof(displayBuf)), 0) << "Unsigned numbers will be bad displayed";
} }
#if !defined(PCBSKY9X)
TEST(EEPROM, 100_random_writes) TEST(EEPROM, 100_random_writes)
{ {
eepromFile = NULL; // in memory eepromFile = NULL; // in memory
@@ -275,6 +276,7 @@ TEST(EEPROM, rm)
} }
EXPECT_EQ(sz, 0); EXPECT_EQ(sz, 0);
} }
#endif
#if defined(FRSKY) && !defined(FRSKY_SPORT) #if defined(FRSKY) && !defined(FRSKY_SPORT)
extern void frskyDProcessPacket(uint8_t *packet); extern void frskyDProcessPacket(uint8_t *packet);
@@ -393,7 +395,7 @@ TEST(getSwitch, nullSW)
EXPECT_EQ(getSwitch(0), true); EXPECT_EQ(getSwitch(0), true);
} }
#if !defined(PCBTARANIS) #if !defined(CPUARM)
TEST(getSwitch, recursiveSW) TEST(getSwitch, recursiveSW)
{ {
MODEL_RESET(); MODEL_RESET();
@@ -784,7 +786,7 @@ TEST(Mixer, SlowDisabledOnStartup)
EXPECT_EQ(chans[0], CHANNEL_MAX); EXPECT_EQ(chans[0], CHANNEL_MAX);
} }
#if !defined(PCBTARANIS) #if !defined(CPUARM)
TEST(Mixer, SlowAndDelayOnReplace3POSSource) TEST(Mixer, SlowAndDelayOnReplace3POSSource)
{ {
MODEL_RESET(); MODEL_RESET();
@@ -1048,6 +1050,13 @@ TEST(Lcd, Invers_0_0)
EXPECT_TRUE(checkScreenshot("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) TEST(Lcd, Prec2_Left)
{ {
lcd_clear(); lcd_clear();
@@ -1062,6 +1071,13 @@ TEST(Lcd, Prec2_Right)
EXPECT_TRUE(checkScreenshot("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) TEST(Lcd, Line_Wrap)
{ {
lcd_clear(); lcd_clear();
@@ -1078,6 +1094,15 @@ TEST(Lcd, Smlsize_putsStrIdx)
} }
#endif #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) int main(int argc, char **argv)
{ {
QCoreApplication app(argc, argv); QCoreApplication app(argc, argv);
Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B