summaryrefslogtreecommitdiff
path: root/glcddrivers/network.c
diff options
context:
space:
mode:
Diffstat (limited to 'glcddrivers/network.c')
-rw-r--r--glcddrivers/network.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/glcddrivers/network.c b/glcddrivers/network.c
index 485f8ea..5000fda 100644
--- a/glcddrivers/network.c
+++ b/glcddrivers/network.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 Andreas Regel <andreas.regel AT powarman.de>
+ * (c) 2004 Andreas Regel <andreas.regel AT powarman.de>
+ * (c) 2011 Wolfgang Astleitner <mrwastl AT users.sourceforge.net>
*/
#include <stdio.h>
@@ -29,19 +30,13 @@ namespace GLCD
{
cDriverNetwork::cDriverNetwork(cDriverConfig * config)
-: config(config)
+: cDriver(config)
{
- oldConfig = new cDriverConfig(*config);
childTid = 0;
running = false;
clientConnected = false;
}
-cDriverNetwork::~cDriverNetwork()
-{
- delete oldConfig;
-}
-
int cDriverNetwork::Init()
{
width = config->width;
@@ -122,6 +117,29 @@ void cDriverNetwork::Clear()
memset(newLCD, 0, lineSize * height);
}
+
+void cDriverNetwork::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[lineSize * y + x / 8] |= (1 << pos);
+ else
+ newLCD[lineSize * y + x / 8] &= ( 0xFF ^ (1 << pos) );
+}
+
+
+#if 0
void cDriverNetwork::Set8Pixels(int x, int y, unsigned char data)
{
if (x >= width || y >= height)
@@ -140,6 +158,7 @@ void cDriverNetwork::Set8Pixels(int x, int y, unsigned char data)
newLCD[lineSize * y + x / 8] |= ReverseBits(data);
}
}
+#endif
void cDriverNetwork::Refresh(bool refreshAll)
{