diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2003-11-12 05:42:35 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2003-11-12 05:42:35 +0000 |
commit | 2ef9c25efa4d90e0f048a038c79e4c16f334c882 (patch) | |
tree | 342b6dae73f479181554bc37101ecaa1e40435a9 | |
parent | 57b7acc1a12e6d6590444560abfe49a045b67cf1 (diff) | |
download | lcd4linux-2ef9c25efa4d90e0f048a038c79e4c16f334c882.tar.gz |
[lcd4linux @ 2003-11-12 05:42:35 by reinelt]
small changes to the 16x4 handling
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@272 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r-- | HD44780.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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; } |