aboutsummaryrefslogtreecommitdiffstats
path: root/M50530.c
diff options
context:
space:
mode:
authorreinelt <>2003-09-09 06:54:43 +0000
committerreinelt <>2003-09-09 06:54:43 +0000
commitb1f5fffddaf31835515f88859f8a4670b6252deb (patch)
treec78e80eb3a22e818c6039ca5aa68c7f46000fd94 /M50530.c
parentb39a42b909dfb1c174044cf977d272f94445b18e (diff)
downloadlcd4linux-b1f5fffddaf31835515f88859f8a4670b6252deb.tar.gz
[lcd4linux @ 2003-09-09 06:54:43 by reinelt]
new function 'cfg_number()'
Diffstat (limited to 'M50530.c')
-rw-r--r--M50530.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/M50530.c b/M50530.c
index 1544a25..0fa506d 100644
--- a/M50530.c
+++ b/M50530.c
@@ -1,4 +1,4 @@
-/* $Id: M50530.c,v 1.12 2003/08/24 05:17:58 reinelt Exp $
+/* $Id: M50530.c,v 1.13 2003/09/09 06:54:43 reinelt Exp $
*
* driver for display modules based on the M50530 chip
*
@@ -20,6 +20,9 @@
*
*
* $Log: M50530.c,v $
+ * Revision 1.13 2003/09/09 06:54:43 reinelt
+ * new function 'cfg_number()'
+ *
* Revision 1.12 2003/08/24 05:17:58 reinelt
* liblcd4linux patch from Patrick Schemitz
*
@@ -179,7 +182,7 @@ int M5_clear (int full)
int M5_init (LCD *Self)
{
int rows=-1, cols=-1, gpos=-1;
- char *s, *e;
+ char *s;
s=cfg_get("Size",NULL);
if (s==NULL || *s=='\0') {
@@ -191,16 +194,7 @@ int M5_init (LCD *Self)
return -1;
}
- s=cfg_get ("GPOs",NULL);
- if (s==NULL) {
- gpos=0;
- } else {
- gpos=strtol(s, &e, 0);
- if (*e!='\0' || gpos<0 || gpos>8) {
- error ("M50530: bad GPOs '%s' in %s", s, cfg_source());
- return -1;
- }
- }
+ if (cfg_number("GPOs", 0, 0, 8, &gpos)<0) return -1;
Self->rows=rows;
Self->cols=cols;