aboutsummaryrefslogtreecommitdiffstats
path: root/processor.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 /processor.c
parentb39a42b909dfb1c174044cf977d272f94445b18e (diff)
downloadlcd4linux-b1f5fffddaf31835515f88859f8a4670b6252deb.tar.gz
[lcd4linux @ 2003-09-09 06:54:43 by reinelt]
new function 'cfg_number()'
Diffstat (limited to 'processor.c')
-rw-r--r--processor.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/processor.c b/processor.c
index 67e1129..481c4eb 100644
--- a/processor.c
+++ b/processor.c
@@ -1,4 +1,4 @@
-/* $Id: processor.c,v 1.39 2003/09/09 05:30:34 reinelt Exp $
+/* $Id: processor.c,v 1.40 2003/09/09 06:54:43 reinelt Exp $
*
* main data processing
*
@@ -20,6 +20,9 @@
*
*
* $Log: processor.c,v $
+ * Revision 1.40 2003/09/09 06:54:43 reinelt
+ * new function 'cfg_number()'
+ *
* Revision 1.39 2003/09/09 05:30:34 reinelt
* even more icons stuff
*
@@ -769,29 +772,26 @@ void process_init (void)
debug ("Display: %d rows, %d columns, %dx%d pixels, %d icons, %d GPOs", rows, cols, xres, yres, icons, gpos);
- lines=atoi(cfg_get("Rows","1"));
- if (lines<1) {
- error ("bad 'Rows' entry in %s, ignoring.", cfg_source());
+ if (cfg_number("Rows", 1, 1, 1000, &lines)<0) {
lines=1;
+ error ("ignoring bad 'Rows' value and using '%d'", lines);
}
if (lines>ROWS) {
error ("%d virtual rows exceeds limit, reducing to %d rows", lines, ROWS);
lines=ROWS;
}
if (lines>rows) {
- scroll=atoi(cfg_get("Scroll","1"));
- if (scroll<1) {
- error ("bad 'Scroll' entry in %s, ignoring and using '1'", cfg_source());
+ if (cfg_number("Scroll", 1, 1, 1000, &scroll)<0) {
scroll=1;
+ error ("ignoring bad 'Scroll' value and using '%d'", scroll);
}
if (scroll>rows) {
error ("'Scroll' entry in %s is %d, > %d display rows.", cfg_source(), scroll, rows);
error ("This may lead to unexpected results!");
}
- turn=atoi(cfg_get("Turn","1000"));
- if (turn<1) {
- error ("bad 'Turn' entry in %s, ignoring and using '1000'", cfg_source());
- turn=1;
+ if (cfg_number("Turn", 1000, 1, 1000000, &turn)<0) {
+ turn=1000;
+ error ("ignoring bad 'Scroll' value and using '%d'", turn);
}
debug ("Virtual: %d rows, scroll %d lines every %d msec", lines, scroll, turn);
} else {
@@ -826,6 +826,9 @@ void process (void)
char *txt;
static int offset=0;
+ // Fixme: smooth has gone...
+ int smooth=0;
+
collect_data();
if (smooth==0 && Turn()) {