diff options
author | nicowallmeier <> | 2003-10-08 06:48:47 +0000 |
---|---|---|
committer | nicowallmeier <> | 2003-10-08 06:48:47 +0000 |
commit | 103b74d6953bb6a644e8aa4d905c9c0a17ee7055 (patch) | |
tree | eb85fb4a572016a9595d9d079bbb87dc7d3b25fa /HD44780.c | |
parent | 7c7bb0c3cdcbdfc2f7aef3ff6c089ac94e586e74 (diff) | |
download | lcd4linux-103b74d6953bb6a644e8aa4d905c9c0a17ee7055.tar.gz |
[lcd4linux @ 2003-10-08 06:48:47 by nicowallmeier]
special handling for 16x4 displays
Diffstat (limited to 'HD44780.c')
-rw-r--r-- | HD44780.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: HD44780.c,v 1.45 2003/10/08 06:45:00 nicowallmeier Exp $ +/* $Id: HD44780.c,v 1.46 2003/10/08 06:48:47 nicowallmeier Exp $ * * driver for display modules based on the HD44780 chip * @@ -29,6 +29,9 @@ * * * $Log: HD44780.c,v $ + * Revision 1.46 2003/10/08 06:48:47 nicowallmeier + * special handling for 16x4 displays + * * Revision 1.45 2003/10/08 06:45:00 nicowallmeier * Support of two displays of the same size * @@ -575,7 +578,12 @@ void HD_goto (int row, int col) col-=8; } - pos=(row%2)*64+(row/2)*20+col; + if (Lcd.rows==4 && Lcd.cols==16) { + pos=(row%2)*64+(row/2)*16+col; + } else { + pos=(row%2)*64+(row/2)*20+col; + } + HD_command (Controller, (0x80|pos), T_EXEC); } |