From 2ef9c25efa4d90e0f048a038c79e4c16f334c882 Mon Sep 17 00:00:00 2001 From: reinelt Date: Wed, 12 Nov 2003 05:42:35 +0000 Subject: [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 --- HD44780.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/HD44780.c b/HD44780.c index 931e492..23b8c9b 100644 --- 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; } -- cgit v1.2.3