diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2003-09-09 06:54:43 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2003-09-09 06:54:43 +0000 |
commit | dd4d20ad1a3970752a4fe81c95c164bf751c0f16 (patch) | |
tree | c78e80eb3a22e818c6039ca5aa68c7f46000fd94 /USBLCD.c | |
parent | ca55019e85e081afe878a93ba0dc83a44d862de9 (diff) | |
download | lcd4linux-dd4d20ad1a3970752a4fe81c95c164bf751c0f16.tar.gz |
[lcd4linux @ 2003-09-09 06:54:43 by reinelt]
new function 'cfg_number()'
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@233 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r-- | USBLCD.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -1,4 +1,4 @@ -/* $Id: USBLCD.c,v 1.13 2003/09/09 05:30:34 reinelt Exp $ +/* $Id: USBLCD.c,v 1.14 2003/09/09 06:54:43 reinelt Exp $ * * Driver for USBLCD ( see http://www.usblcd.de ) * This Driver is based on HD44780.c @@ -22,6 +22,9 @@ * * * $Log: USBLCD.c,v $ + * Revision 1.14 2003/09/09 06:54:43 reinelt + * new function 'cfg_number()' + * * Revision 1.13 2003/09/09 05:30:34 reinelt * even more icons stuff * @@ -224,7 +227,7 @@ int USBLCD_clear (int full) int USBLCD_init (LCD *Self) { int rows=-1, cols=-1 ; - char *port, *s, *e; + char *port, *s; if (Port) { free(Port); @@ -275,13 +278,7 @@ int USBLCD_init (LCD *Self) if (USBLCD_open()!=0) return -1; - s=cfg_get("Icons", "0"); - Icons=strtol(s, &e, 0); - if (*e!='\0' || Icons<0 || Icons>8) { - debug ("Icons=%d e=<%s>", Icons, e); - error ("USBLCD: bad Icons '%s' in %s, must be between 0 and 8", s, cfg_source()); - return -1; - } + if (cfg_number("Icons", 0, 0, 8, &Icons)<0) return -1; if (Icons>0) { info ("reserving %d of %d user-defined characters for icons", Icons, CHARS); icon_init(Lcd.rows, Lcd.cols, XRES, YRES, CHARS, Icons, USBLCD_define_char); @@ -335,7 +332,6 @@ int USBLCD_flush (void) { int row, col, pos1, pos2; int c, equal; - static int junk=0; //Fixme bar_process(USBLCD_define_char); |