aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2003-11-30 16:18:36 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2003-11-30 16:18:36 +0000
commit7e0ca2796bf0e4dbec689211ba00ce86a393b83c (patch)
tree802126e0e0b5d29036440adab97deddf9315db5c
parentfb1014d1ddb8ee13ebd7d835c66ad189bb17c822 (diff)
downloadlcd4linux-7e0ca2796bf0e4dbec689211ba00ce86a393b83c.tar.gz
[lcd4linux @ 2003-11-30 16:18:36 by reinelt]
Cwlinux: invalidate Framebuffer in case a char got redefined git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@277 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r--Cwlinux.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/Cwlinux.c b/Cwlinux.c
index cca90a0..3ae72ab 100644
--- a/Cwlinux.c
+++ b/Cwlinux.c
@@ -1,4 +1,4 @@
-/* $Id: Cwlinux.c,v 1.15 2003/10/05 17:58:50 reinelt Exp $
+/* $Id: Cwlinux.c,v 1.16 2003/11/30 16:18:36 reinelt Exp $
*
* driver for Cwlinux serial display modules
*
@@ -22,6 +22,9 @@
*
*
* $Log: Cwlinux.c,v $
+ * Revision 1.16 2003/11/30 16:18:36 reinelt
+ * Cwlinux: invalidate Framebuffer in case a char got redefined
+ *
* Revision 1.15 2003/10/05 17:58:50 reinelt
* libtool junk; copyright messages cleaned up
*
@@ -203,7 +206,7 @@ static void CW12232_define_char (int ascii, char *buffer)
cmd[3+i]=0;
for (j=0; j<8;j++) {
if (buffer[j] & (1<<(5-i))) {
- cmd[3+i]|=(1<<(7-j));
+ cmd[3+i]|=(1<<j);
}
}
}
@@ -406,8 +409,15 @@ int CW_flush(void)
c=bar_peek(row, col);
if (c==-1) c=icon_peek(row, col);
if (c!=-1) {
- if (c!=32) c++; //blank
+ if (c!=32) c++; // blank
FrameBuffer1[row*Lcd.cols+col]=(char)c;
+ // invalidate FrameBuffer:
+ // Cwlinux does not update the display of a user-defined char
+ // if it is redefined only. We have to definitely write it
+ // to the display! We force this by invalidating the DoubleBuffer.
+ // Fixme: This is bad: we should try to remember which chars
+ // got redefined, and invalidate only those...
+ FrameBuffer2[row*Lcd.cols+col]=0;
}
}
for (col = 0; col < Lcd.cols; col++) {
@@ -416,8 +426,8 @@ int CW_flush(void)
for (pos1=col++, pos2=pos1, equal=0; col<Lcd.cols; col++) {
if (FrameBuffer1[row*Lcd.cols+col]==FrameBuffer2[row*Lcd.cols+col]) {
// If we find just one equal byte, we don't break, because this
- // would require a goto, which takes one byte, too.
- if (++equal>6) break;
+ // would require a goto, which takes five bytes, too.
+ if (++equal>5) break;
} else {
pos2=col;
equal=0;