Forked para SNOCC
Fork of RA8875 by
Diff: RA8875.cpp
- Revision:
- 60:2dfd574f63bd
- Parent:
- 59:fb40aad4efd4
- Child:
- 61:8f3153bf0baa
--- a/RA8875.cpp Thu Jul 24 00:41:37 2014 +0000 +++ b/RA8875.cpp Sat Aug 16 19:26:17 2014 +0000 @@ -814,15 +814,19 @@ RetCode_t RA8875::line(loc_t x1, loc_t y1, loc_t x2, loc_t y2) { PERFORMANCE_RESET; - WriteCommandW(0x91, x1); - WriteCommandW(0x93, y1); - WriteCommandW(0x95, x2); - WriteCommandW(0x97, y2); - unsigned char drawCmd = 0x00; // Line - WriteCommand(0x90, drawCmd); - WriteCommand(0x90, 0x80 + drawCmd); // Start drawing. - while (ReadCommand(0x90) & 0x80) // await completion. - wait_us(POLLWAITuSec); + if (x1 == x2 && y1 == y2) + pixel(x1, y1); + else { + WriteCommandW(0x91, x1); + WriteCommandW(0x93, y1); + WriteCommandW(0x95, x2); + WriteCommandW(0x97, y2); + unsigned char drawCmd = 0x00; // Line + WriteCommand(0x90, drawCmd); + WriteCommand(0x90, 0x80 + drawCmd); // Start drawing. + while (ReadCommand(0x90) & 0x80) // await completion. + wait_us(POLLWAITuSec); + } REGISTERPERFORMANCE(PRF_DRAWLINE); return noerror; }