LCD LIB
Fork of RA8875 by
Diff: RA8875.cpp
- Revision:
- 62:ba5d33438fda
- Parent:
- 61:8f3153bf0baa
- Child:
- 66:468a11f05580
--- a/RA8875.cpp Sun Aug 17 13:46:06 2014 +0000 +++ b/RA8875.cpp Sun Aug 17 15:38:51 2014 +0000 @@ -738,12 +738,17 @@ RetCode_t RA8875::pixel(loc_t x, loc_t y, color_t color) { + RetCode_t ret; + + PERFORMANCE_RESET; #if 1 - return pixelStream(&color, 1, x,y); + ret = pixelStream(&color, 1, x,y); #else foreground(color); - return pixel(x,y); + ret = pixel(x,y); #endif + REGISTERPERFORMANCE(PRF_DRAWPIXEL); + return ret; } @@ -753,11 +758,15 @@ PERFORMANCE_RESET; color_t color = GetForeColor(); + #if 1 + ret = pixelStream(&color, 1, x, y); + #else WriteCommand(0x40,0x00); // Graphics write mode SetGraphicsCursor(x, y); WriteCommand(0x02); WriteDataW(color); ret = noerror; + #endif REGISTERPERFORMANCE(PRF_DRAWPIXEL); return ret; } @@ -835,9 +844,9 @@ RetCode_t RA8875::line(loc_t x1, loc_t y1, loc_t x2, loc_t y2) { PERFORMANCE_RESET; - if (x1 == x2 && y1 == y2) + if (x1 == x2 && y1 == y2) { pixel(x1, y1); - else { + } else { WriteCommandW(0x91, x1); WriteCommandW(0x93, y1); WriteCommandW(0x95, x2); @@ -1567,6 +1576,41 @@ y2 = rand() % 272; display.line(x,y, x2,y2, display.DOSColor(i)); } + display.foreground(BrightRed); + pc.printf("fg %08X %08X %08X\r\n", RGB(255,0,0), BrightRed, display.GetForeColor()); + display.foreground(BrightGreen); + pc.printf("fg %08X %08X %08X\r\n", RGB(0,255,0), BrightGreen, display.GetForeColor()); + display.foreground(BrightBlue); + pc.printf("fg %08X %08X %08X\r\n", RGB(0,0,255), BrightBlue, display.GetForeColor()); + display.line(55,50, 79,74, BrightRed); + display.line(57,50, 81,74, BrightGreen); + display.line(59,50, 83,74, BrightBlue); + // horz + display.line(30,40, 32,40, BrightRed); + display.line(30,42, 32,42, BrightGreen); + display.line(30,44, 32,44, BrightBlue); + // vert + display.line(20,40, 20,42, BrightRed); + display.line(22,40, 22,42, BrightGreen); + display.line(24,40, 24,42, BrightBlue); + // compare point to line-point + display.pixel(20,50, BrightRed); + display.pixel(22,50, BrightGreen); + display.pixel(24,50, BrightBlue); + display.line(20,52, 20,52, BrightRed); + display.line(22,52, 22,52, BrightGreen); + display.line(24,52, 24,52, BrightBlue); + + // point + display.line(50,50, 50,50, Red); + display.line(52,52, 52,52, Green); + display.line(54,54, 54,54, Blue); + display.line(60,60, 60,60, BrightRed); + display.line(62,62, 62,62, BrightGreen); + display.line(64,64, 64,64, BrightBlue); + display.line(70,70, 70,70, DarkRed); + display.line(72,72, 72,72, DarkGreen); + display.line(74,74, 74,74, DarkBlue); }