diff options
author | reinelt <> | 2000-03-22 07:33:50 +0000 |
---|---|---|
committer | reinelt <> | 2000-03-22 07:33:50 +0000 |
commit | 26521bed933853a430ccb086524bd5bb9d2a78ba (patch) | |
tree | 78359df06662d6d2a440f2aac1408b91b3d571fd /filter.c | |
parent | eba1b69ca09ac69949ae0d76fd7d1738c680c70a (diff) | |
download | lcd4linux-26521bed933853a430ccb086524bd5bb9d2a78ba.tar.gz |
[lcd4linux @ 2000-03-22 07:33:50 by reinelt]
FAQ added
new modules 'processor.c' contains all data processing
Diffstat (limited to '')
-rw-r--r-- | filter.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: filter.c,v 1.2 2000/03/06 06:04:06 reinelt Exp $ +/* $Id: filter.c,v 1.3 2000/03/22 07:33:50 reinelt Exp $ * * smooth and damp functions * @@ -20,11 +20,15 @@ * * * $Log: filter.c,v $ + * Revision 1.3 2000/03/22 07:33:50 reinelt + * + * FAQ added + * new modules 'processor.c' contains all data processing + * * Revision 1.2 2000/03/06 06:04:06 reinelt * * minor cleanups * - * */ /* @@ -37,7 +41,6 @@ * * damp (name, value) * damps a value with exp(-t/tau) - * uses global variable "tau" * */ @@ -47,10 +50,10 @@ #include <math.h> #include <sys/time.h> +#include "cfg.h" #include "filter.h" extern int tick; -extern int tau; #define SLOTS 64 #define SECONDS(x) (x.tv_sec+x.tv_usec/1000000.0) @@ -116,12 +119,16 @@ double smooth(char *name, int period, double value) double damp(char *name, double value) { + static int tau=-1; static FILTER *Filter=NULL; static int nFilter=0; struct timeval now; double max; int i, j; + if (tau==-1) + tau=atoi(cfg_get("tau")); + if (tau==0.0) return value; |