From ca55019e85e081afe878a93ba0dc83a44d862de9 Mon Sep 17 00:00:00 2001 From: reinelt Date: Tue, 9 Sep 2003 05:30:34 +0000 Subject: [lcd4linux @ 2003-09-09 05:30:33 by reinelt] even more icons stuff git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@232 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- processor.c | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'processor.c') diff --git a/processor.c b/processor.c index 1ca308a..67e1129 100644 --- a/processor.c +++ b/processor.c @@ -1,4 +1,4 @@ -/* $Id: processor.c,v 1.38 2003/09/01 04:09:35 reinelt Exp $ +/* $Id: processor.c,v 1.39 2003/09/09 05:30:34 reinelt Exp $ * * main data processing * @@ -20,6 +20,9 @@ * * * $Log: processor.c,v $ + * Revision 1.39 2003/09/09 05:30:34 reinelt + * even more icons stuff + * * Revision 1.38 2003/09/01 04:09:35 reinelt * icons nearly finished, but MatrixOrbital only * @@ -174,13 +177,12 @@ * void process_init (void); * does all necessary initializations * - * void process (int smooth); + * void process (); * processes a whole screen - * bars will always be processed - * texts only if smooth=0 * */ + #include #include #include @@ -224,6 +226,7 @@ static struct { int num, unseen;} mail[MAILBOXES+1]; static struct { double val, min, max; } sensor[SENSORS+1]; static struct { double strength, snr; } dvb; + static double query (int token) { switch (token&255) { @@ -332,6 +335,7 @@ static double query (int token) return 0.0; } + /* return a value 0..1 */ static double query_bar (int token) { @@ -401,6 +405,7 @@ static double query_bar (int token) return value; } + static void print_token (int token, char **p, char *start) { double val; @@ -513,12 +518,12 @@ static void print_token (int token, char **p, char *start) break; case T_BATT_STAT: { int ival = (int) query(token); - switch (ival) { - case 0: **p = '='; break; - case 1: **p = '+'; break; - case 2: **p = '-'; break; - default: **p = '?'; break; - } + switch (ival) { + case 0: **p = '='; break; + case 1: **p = '+'; break; + case 2: **p = '-'; break; + default: **p = '?'; break; + } } (*p)++; break; @@ -553,10 +558,11 @@ static void print_token (int token, char **p, char *start) break; default: - *p+=sprintf (*p, "%5.0f", query(token)); + *p+=sprintf (*p, "%5.0f", query(token)); } } + static void collect_data (void) { int i; @@ -635,6 +641,7 @@ static void collect_data (void) } + static char *process_row (char *data, int row, int len) { static char buffer[256]; @@ -674,14 +681,14 @@ static char *process_row (char *data, int row, int len) if (type & BAR_H) { for (i=0; i 0.0); } + static int Turn (void) { static struct timeval old = {tv_sec:0, tv_usec:0}; @@ -736,6 +745,7 @@ static int Turn (void) return 0; } + void process_init (void) { int i; @@ -809,7 +819,8 @@ void process_init (void) } } -void process (int smooth) + +void process (void) { int i, j, val; char *txt; -- cgit v1.2.3