Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of 4DGL-uLCD-SE by
Revision 9:2cb1845d7681, committed 2015-10-28
- Comitter:
- 4180_1
- Date:
- Wed Oct 28 14:52:48 2015 +0000
- Parent:
- 7:e39a44de229a
- Commit message:
- Added include guards and Fixed Read Pixel bug
Changed in this revision
uLCD_4DGL.h | Show annotated file Show diff for this revision Revisions of this file |
uLCD_4DGL_Graphics.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/uLCD_4DGL.h Sat Nov 30 02:05:15 2013 +0000 +++ b/uLCD_4DGL.h Wed Oct 28 14:52:48 2015 +0000 @@ -21,7 +21,8 @@ // @author Stephane Rochon #include "mbed.h" - +#ifndef _uLCD +#define _uLCD 0 // Debug Verbose off - SGE commands echoed to USB serial for debugmode=1 #ifndef DEBUGMODE #define DEBUGMODE 0 @@ -336,6 +337,7 @@ }; typedef unsigned char BYTE; +#endif @@ -343,4 +345,3 @@ -
--- a/uLCD_4DGL_Graphics.cpp Sat Nov 30 02:05:15 2013 +0000 +++ b/uLCD_4DGL_Graphics.cpp Wed Oct 28 14:52:48 2015 +0000 @@ -275,7 +275,7 @@ command[5] = y & 0xFF; int i, temp = 0, color = 0, resp = 0; - char response[2] = ""; + char response[3] = ""; freeBUFFER(); @@ -283,16 +283,16 @@ writeBYTE(command[i]); } - while (!_cmd.readable()) wait_ms(TEMPO); // wait for screen answer + while (!_cmd.readable()) wait_ms(TEMPO); // wait a bit for screen answer - while (_cmd.readable() && resp < ARRAY_SIZE(response)) { + while ( resp < ARRAY_SIZE(response)) { //read ack and 16-bit color response temp = _cmd.getc(); response[resp++] = (char)temp; } - color = ((response[0] << 8) + response[1]); + color = ((response[1] << 8) + response[2]); - return color; // WARNING : this is 16bits color, not 24bits... need to be fixed + return color; }