summaryrefslogtreecommitdiff
path: root/glcddrivers/avrctl.c
diff options
context:
space:
mode:
authormrwastl <mrwastl@users.sourceforge.net>2011-06-25 21:52:54 +0200
committermrwastl <mrwastl@users.sourceforge.net>2011-06-25 21:52:54 +0200
commit82d929736a6188583fe3283b8fa2ce776f3cca21 (patch)
tree1a894c5a603415086db3e3cdbb9b8d15fabc94a5 /glcddrivers/avrctl.c
parentd7b7ae09a995d8ceab70a9d7904a7b9e25beba00 (diff)
downloadgraphlcd-base-82d929736a6188583fe3283b8fa2ce776f3cca21.tar.gz
graphlcd-base-82d929736a6188583fe3283b8fa2ce776f3cca21.tar.bz2
adapt all drivers to support SetPixel() with 32bit colours; Set8Pixels() is no longer virtual (generic implementation in base class)
Diffstat (limited to 'glcddrivers/avrctl.c')
-rw-r--r--glcddrivers/avrctl.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/glcddrivers/avrctl.c b/glcddrivers/avrctl.c
index b0e09b9..1f5d155 100644
--- a/glcddrivers/avrctl.c
+++ b/glcddrivers/avrctl.c
@@ -6,7 +6,8 @@
* This file is released under the GNU General Public License. Refer
* to the COPYING file distributed with this package.
*
- * (c) 2005 Andreas Regel <andreas.regel AT powarman.de>
+ * (c) 2005-2010 Andreas Regel <andreas.regel AT powarman.de>
+ * (c) 2011 Wolfgang Astleitner <mrwastl AT users.sourceforge.net>
*/
#include <stdint.h>
@@ -176,6 +177,27 @@ void cDriverAvrCtl::Clear()
memset(newLCD[x], 0, (kBufferHeight + 7) / 8);
}
+
+void cDriverAvrCtl::SetPixel(int x, int y, uint32_t data)
+{
+ if (x >= width || y >= height)
+ return;
+
+ if (config->upsideDown)
+ {
+ x = width - 1 - x;
+ y = height - 1 - y;
+ }
+
+ int offset = 7 - (y % 8);
+ if (data == GLCD::cColor::White)
+ newLCD[x][y / 8] |= (1 << offset);
+ else
+ newLCD[x][y / 8] &= ( 0xFF ^ (1 << offset) );
+}
+
+
+#if 0
void cDriverAvrCtl::Set8Pixels(int x, int y, unsigned char data)
{
if (x >= width || y >= height)
@@ -200,6 +222,7 @@ void cDriverAvrCtl::Set8Pixels(int x, int y, unsigned char data)
}
}
}
+#endif
void cDriverAvrCtl::Refresh(bool refreshAll)
{