summaryrefslogtreecommitdiff
path: root/glcddrivers/gu140x32f.c
diff options
context:
space:
mode:
Diffstat (limited to 'glcddrivers/gu140x32f.c')
-rw-r--r--glcddrivers/gu140x32f.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/glcddrivers/gu140x32f.c b/glcddrivers/gu140x32f.c
index c3990a3..3cf568e 100644
--- a/glcddrivers/gu140x32f.c
+++ b/glcddrivers/gu140x32f.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 Andreas Brachold <vdr04 AT deltab.de>
+ * (c) 2003 Andreas Brachold <vdr04 AT deltab.de>
+ * (c) 2005-2010 Andreas Regel <andreas.regel AT powarman.de>
+ * (c) 2011 Wolfgang Astleitner <mrwastl AT users.sourceforge.net>
*/
#include <errno.h>
@@ -96,12 +98,10 @@ static const std::string kWiringWindows = "Windows";
cDriverGU140X32F::cDriverGU140X32F(cDriverConfig * config)
-: config(config),
+: cDriver(config),
m_pDrawMem(0),
m_pVFDMem(0)
{
- oldConfig = new cDriverConfig(*config);
-
port = new cParallelPort();
m_nRefreshCounter = 0;
@@ -110,7 +110,6 @@ cDriverGU140X32F::cDriverGU140X32F(cDriverConfig * config)
cDriverGU140X32F::~cDriverGU140X32F()
{
delete port;
- delete oldConfig;
}
int cDriverGU140X32F::Init()
@@ -326,7 +325,7 @@ void cDriverGU140X32F::Write(unsigned char nFlags, unsigned char bData, unsigned
nSleepDeInit();
}
-void cDriverGU140X32F::SetPixel(int x, int y)
+void cDriverGU140X32F::SetPixel(int x, int y, uint32_t data)
{
unsigned char c;
int n;
@@ -348,9 +347,13 @@ void cDriverGU140X32F::SetPixel(int x, int y)
n = x + ((y / 8) * width);
c = 0x80 >> (y % 8);
- m_pDrawMem[n] |= c;
+ if (data == GRAPHLCD_White)
+ m_pDrawMem[n] |= c;
+ else
+ m_pDrawMem[n] &= (0xFF ^ c);
}
+#if 0
void cDriverGU140X32F::Set8Pixels(int x, int y, unsigned char data)
{
int n;
@@ -361,9 +364,10 @@ void cDriverGU140X32F::Set8Pixels(int x, int y, unsigned char data)
for (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 cDriverGU140X32F::Refresh(bool refreshAll)
{