summaryrefslogtreecommitdiff
path: root/glcddrivers/dm140gink.c
diff options
context:
space:
mode:
Diffstat (limited to 'glcddrivers/dm140gink.c')
-rw-r--r--glcddrivers/dm140gink.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/glcddrivers/dm140gink.c b/glcddrivers/dm140gink.c
index c7efdba..4f73c42 100644
--- a/glcddrivers/dm140gink.c
+++ b/glcddrivers/dm140gink.c
@@ -7,7 +7,8 @@
* This file is released under the GNU General Public License. Refer
* to the COPYING file distributed with this package.
*
- * (c) 2004 Stephan Skrodzki
+ * (c) 2004 Stephan Skrodzki
+ * (c) 2011-2013 Wolfgang Astleitner <mrwastl AT users.sourceforge.net>
*/
#include <fcntl.h>
@@ -30,16 +31,10 @@ namespace GLCD
{
cDriverDM140GINK::cDriverDM140GINK(cDriverConfig * config)
-: config(config),
+: cDriver(config),
fd(-1),
framebuff(0)
{
- oldConfig = new cDriverConfig(*config);
-}
-
-cDriverDM140GINK::~cDriverDM140GINK()
-{
- delete oldConfig;
}
/* hack - fix improper signed char handling - it's seeing 0x80 as a negative value*/
@@ -92,7 +87,7 @@ int cDriverDM140GINK::SendReport(const char *cbuf, size_t size)
//**************************************************************
if((err = ioctl(fd, HIDIOCSUSAGE, &uref)) < 0)
{
- syslog(LOG_INFO, "%s: Error with sending the USAGE ioctl %d,0x%02X;size:%d\n", config->name.c_str(), i, (int)buf[i],size);
+ syslog(LOG_INFO, "%s: Error with sending the USAGE ioctl %d,0x%02X;size:%d\n", config->name.c_str(), (int)i, (int)buf[i], (int)size);
return err;
}
uref.usage_code = 0xffa10006; //unused?
@@ -254,7 +249,7 @@ int cDriverDM140GINK::CheckSetup()
return 0;
}
-void cDriverDM140GINK::SetPixel(int x, int y)
+void cDriverDM140GINK::SetPixel(int x, int y, uint32_t data)
{
if (x >= width || y >= height)
return;
@@ -267,7 +262,10 @@ void cDriverDM140GINK::SetPixel(int x, int y)
int offset = (y/8) * width + x;
char mask = (1 << (7 - (y%8)));
- framebuff[offset] |= mask;
+ if (data == GRAPHLCD_White)
+ framebuff[offset] |= mask;
+ else
+ framebuff[offset] &= (0xFF ^ mask);
}
void cDriverDM140GINK::Clear()
@@ -275,6 +273,7 @@ void cDriverDM140GINK::Clear()
memset(framebuff, 0, screensize);
}
+#if 0
void cDriverDM140GINK::Set8Pixels(int x, int y, unsigned char data)
{
x &= 0xFFF8;
@@ -282,9 +281,10 @@ void cDriverDM140GINK::Set8Pixels(int x, int y, unsigned char data)
for (int n = 0; n < 8; ++n)
{
if (data & (0x80 >> n)) // if bit is set
- SetPixel(x + n, y);
+ SetPixel(x + n, y, GRAPHLCD_White);
}
}
+#endif
void cDriverDM140GINK::Refresh(bool refreshAll)
{