Display problems on Sky9x
@@ -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; i<width+2 && p<end; i++) {
|
||||
uint8_t lines = (height+7)/8;
|
||||
assert(lines <= 5);
|
||||
uint8_t b[5] = { 0 };
|
||||
if (i==0) {
|
||||
if (x==0 || !inv) {
|
||||
lcdNextPos++;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
// we need to work on the previous byte when INVERS
|
||||
p--;
|
||||
}
|
||||
}
|
||||
else if (i<=width) {
|
||||
uint8_t skip = true;
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
b[j] = pgm_read_byte(pattern++); /*top byte*/
|
||||
if (b[j] != 0xff) {
|
||||
skip = false;
|
||||
}
|
||||
}
|
||||
if (skip) {
|
||||
if (flags & FIXEDWIDTH) {
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
b[j] = 0;
|
||||
}
|
||||
uint8_t lines = (height+7)/8;
|
||||
assert(lines <= 5);
|
||||
|
||||
for (int8_t i=0; i<width+2; i++) {
|
||||
if (p<end) {
|
||||
uint8_t b[5] = { 0 };
|
||||
if (i==0) {
|
||||
if (x==0 || !inv) {
|
||||
lcdNextPos++;
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
// we need to work on the previous byte when INVERS
|
||||
p--;
|
||||
}
|
||||
}
|
||||
else if (i<=width) {
|
||||
uint8_t skip = true;
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
b[j] = pgm_read_byte(pattern++); /*top byte*/
|
||||
if (b[j] != 0xff) {
|
||||
skip = false;
|
||||
}
|
||||
}
|
||||
if (skip) {
|
||||
if (flags & FIXEDWIDTH) {
|
||||
for (uint8_t j=0; j<lines; j++) {
|
||||
b[j] = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((flags & CONDENSED) && i==2) {
|
||||
/*condense the letter by skipping column 3 */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ((flags & CONDENSED) && i==2) {
|
||||
/*condense the letter by skipping column 3 */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
const uint8_t ym8 = (y & 0x07);
|
||||
const uint8_t keepref = (1 << ((height&0x07)+1)) - 1;
|
||||
uint8_t * dest = p;
|
||||
for (uint8_t j=0; j<lines+1; j++) {
|
||||
if (dest < DISPLAY_END) {
|
||||
uint8_t b1=0, b2=0, keep=0;
|
||||
if (j>0) {
|
||||
b1 = b[j-1] >> (8-ym8);
|
||||
}
|
||||
else {
|
||||
keep = ~(keepref << ym8);
|
||||
}
|
||||
if (j<lines) {
|
||||
if (inv) {
|
||||
b[j] = ~b[j];
|
||||
if (j==lines-1) {
|
||||
if (height >= 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; j<lines+1; j++) {
|
||||
if (dest < DISPLAY_END) {
|
||||
uint8_t b1=0, b2=0, keep=0;
|
||||
if (j>0) {
|
||||
b1 = b[j-1] >> (8-ym8);
|
||||
}
|
||||
b2 = b[j] << ym8;
|
||||
else {
|
||||
keep = ~(keepref << ym8);
|
||||
}
|
||||
if (j<lines) {
|
||||
if (inv) {
|
||||
b[j] = ~b[j];
|
||||
}
|
||||
b2 = b[j] << ym8;
|
||||
}
|
||||
else {
|
||||
keep = ~(keepref >> (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;
|
||||
|
||||
@@ -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--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
After Width: | Height: | Size: 352 B |
|
After Width: | Height: | Size: 375 B |
|
After Width: | Height: | Size: 365 B |
|
After Width: | Height: | Size: 387 B |
|
After Width: | Height: | Size: 320 B |
|
After Width: | Height: | Size: 464 B |
|
After Width: | Height: | Size: 503 B |