diff options
Diffstat (limited to 'glcddrivers/sed1330.c')
-rw-r--r-- | glcddrivers/sed1330.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/glcddrivers/sed1330.c b/glcddrivers/sed1330.c index e993ca0..872cf89 100644 --- a/glcddrivers/sed1330.c +++ b/glcddrivers/sed1330.c @@ -14,7 +14,9 @@ * This file is released under the GNU General Public License. Refer * to the COPYING file distributed with this package. * - * (c) 2003 Roland Praml <praml.roland AT t-online.de> + * (c) 2003 Roland Praml <praml.roland AT t-online.de> + * (c) 2005-2010 Andreas Regel <andreas.regel AT powarman.de> + * (c) 2011 Wolfgang Astleitner <mrwastl AT users.sourceforge.net> */ #include <syslog.h> @@ -129,10 +131,8 @@ const unsigned char kYASEDWCSLO = kSelectLow; cDriverSED1330::cDriverSED1330(cDriverConfig * config) -: config(config) +: cDriver(config) { - oldConfig = new cDriverConfig(*config); - port = new cParallelPort(); refreshCounter = 0; @@ -141,7 +141,6 @@ cDriverSED1330::cDriverSED1330(cDriverConfig * config) cDriverSED1330::~cDriverSED1330() { delete port; - delete oldConfig; } int cDriverSED1330::Init() @@ -539,6 +538,29 @@ void cDriverSED1330::Clear() memset(newLCD[x], 0, height); } + +void cDriverSED1330::SetPixel(int x, int y, uint32_t data) +{ + if (x >= width || y >= height) + return; + + int pos = x % 8; + if (config->upsideDown) + { + x = width - 1 - x; + y = height - 1 - y; + } else { + pos = 7 - pos; // reverse bit position + } + + if (data == GRAPHLCD_White) + newLCD[x / 8][y] |= (1 << pos); + else + newLCD[x / 8][y] &= ( 0xFF ^ (1 << pos) ); +} + + +#if 0 void cDriverSED1330::Set8Pixels(int x, int y, unsigned char data) { if (x >= width || y >= height) @@ -557,6 +579,7 @@ void cDriverSED1330::Set8Pixels(int x, int y, unsigned char data) newLCD[x / 8][y] = newLCD[x / 8][y] | ReverseBits(data); } } +#endif void cDriverSED1330::Refresh(bool refreshAll) { |