From 42fbc61ad0f0f9d165c19a0e8aa33b9d5f7f303b Mon Sep 17 00:00:00 2001 From: reinelt Date: Fri, 19 Mar 2004 09:17:46 +0000 Subject: [lcd4linux @ 2004-03-19 09:17:46 by reinelt] removed the extra 'goto' function, row and col are additional parameters of the write() function now. git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@404 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- drv_USBLCD.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'drv_USBLCD.c') diff --git a/drv_USBLCD.c b/drv_USBLCD.c index 2522388..69273af 100644 --- a/drv_USBLCD.c +++ b/drv_USBLCD.c @@ -1,4 +1,4 @@ -/* $Id: drv_USBLCD.c,v 1.1 2004/02/15 08:22:47 reinelt Exp $ +/* $Id: drv_USBLCD.c,v 1.2 2004/03/19 09:17:46 reinelt Exp $ * * new style driver for USBLCD displays * @@ -26,6 +26,11 @@ * * * $Log: drv_USBLCD.c,v $ + * Revision 1.2 2004/03/19 09:17:46 reinelt + * + * removed the extra 'goto' function, row and col are additional parameters + * of the write() function now. + * * Revision 1.1 2004/02/15 08:22:47 reinelt * ported USBLCD driver to NextGeneration * added drv_M50530.c (I forgot yesterday, sorry) @@ -109,28 +114,30 @@ static void drv_UL_command (unsigned char cmd) } -static void drv_UL_write (unsigned char *string, int len) +static void drv_UL_write (int row, int col, unsigned char *data, int len) { + int pos=(row%2)*64+(row/2)*20+col; + drv_UL_command (0x80|pos); + while (len--) { - if(*string==0) *BufPtr++=*string; - *BufPtr++=*string++; + if(*data==0) *BufPtr++=*data; + *BufPtr++=*data++; } - drv_UL_send(); -} - -static void drv_UL_goto (int row, int col) -{ - int pos=(row%2)*64+(row/2)*20+col; - drv_UL_command (0x80|pos); + drv_UL_send(); } - static void drv_UL_defchar (int ascii, unsigned char *buffer) { + int i; + drv_UL_command (0x40|8*ascii); - drv_UL_write (buffer, 8); - // drv_UL_write() will call drv_UL_send(), so don't call it here! + + for (i=0; i<8; i++) { + *BufPtr++ = *buffer++; + } + + drv_UL_send(); } @@ -283,7 +290,6 @@ int drv_UL_init (char *section) // real worker functions drv_generic_text_real_write = drv_UL_write; - drv_generic_text_real_goto = drv_UL_goto; drv_generic_text_real_defchar = drv_UL_defchar; -- cgit v1.2.3