summaryrefslogtreecommitdiff
path: root/glcddrivers/avrctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'glcddrivers/avrctl.c')
-rw-r--r--glcddrivers/avrctl.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/glcddrivers/avrctl.c b/glcddrivers/avrctl.c
index b0e09b9..2261d95 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>
@@ -50,10 +51,8 @@ const int kBufferHeight = 128;
cDriverAvrCtl::cDriverAvrCtl(cDriverConfig * config)
-: config(config)
+: cDriver(config)
{
- oldConfig = new cDriverConfig(*config);
-
port = new cSerialPort();
//width = config->width;
@@ -64,7 +63,6 @@ cDriverAvrCtl::cDriverAvrCtl(cDriverConfig * config)
cDriverAvrCtl::~cDriverAvrCtl()
{
delete port;
- delete oldConfig;
}
int cDriverAvrCtl::Init()
@@ -176,6 +174,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 == GRAPHLCD_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 +219,7 @@ void cDriverAvrCtl::Set8Pixels(int x, int y, unsigned char data)
}
}
}
+#endif
void cDriverAvrCtl::Refresh(bool refreshAll)
{