]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2003-11-12 05:42:35 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 12 Nov 2003 05:42:35 +0000 (05:42 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Wed, 12 Nov 2003 05:42:35 +0000 (05:42 +0000)
small changes to the 16x4 handling

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@272 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

HD44780.c

index 931e4929cc14c26ce97dda0103c706a04fc886ec..23b8c9bc244063d499c92238284b9f312736c056 100644 (file)
--- a/HD44780.c
+++ b/HD44780.c
@@ -1,4 +1,4 @@
-/* $Id: HD44780.c,v 1.46 2003/10/08 06:48:47 nicowallmeier Exp $
+/* $Id: HD44780.c,v 1.47 2003/11/12 05:42:35 reinelt Exp $
  *
  * driver for display modules based on the HD44780 chip
  *
@@ -29,6 +29,9 @@
  *
  *
  * $Log: HD44780.c,v $
+ * Revision 1.47  2003/11/12 05:42:35  reinelt
+ * small changes to the 16x4 handling
+ *
  * Revision 1.46  2003/10/08 06:48:47  nicowallmeier
  * special handling for 16x4 displays
  *
@@ -565,6 +568,7 @@ void HD_goto (int row, int col)
 {
   int pos;
 
+  // handle multiple displays/controllers
   if (Controllers>1 && row>=Lcd.rows/2) {
     row -= Lcd.rows/2;
     Controller = 2;
@@ -573,13 +577,14 @@ void HD_goto (int row, int col)
   }
    
   // 16x1 Displays are organized as 8x2 :-(
-  if (Lcd.rows==1 && Lcd.cols==16 && col>7) {
+  if (Lcd.cols==16 && Lcd.rows==1 && col>7) {
     row++;
     col-=8;
   }
   
-  if (Lcd.rows==4 && Lcd.cols==16) {
-       pos=(row%2)*64+(row/2)*16+col;
+  // 16x4 Displays use a slightly different layout
+  if (Lcd.cols==16 && Lcd.rows==4) {
+    pos=(row%2)*64+(row/2)*16+col;
   } else {  
     pos=(row%2)*64+(row/2)*20+col;
   }