Fri, 09 May 2014 20:39:01 +0200
Added user log function for program data
lib/Makefile | file | annotate | diff | comparison | revisions | |
lib/dht11.c | file | annotate | diff | comparison | revisions | |
lib/mbselib.h | file | annotate | diff | comparison | revisions | |
lib/rc-switch.c | file | annotate | diff | comparison | revisions | |
lib/rdconfig.c | file | annotate | diff | comparison | revisions |
--- a/lib/Makefile Thu May 08 22:36:51 2014 +0200 +++ b/lib/Makefile Fri May 09 20:39:01 2014 +0200 @@ -2,8 +2,10 @@ include ../Makefile.global -SRCS = xutil.c rdconfig.c lcd-pcf8574.c rc-switch.c dht11.c -OBJS = xutil.o rdconfig.o lcd-pcf8574.o rc-switch.o dht11.o +SRCS = xutil.c rdconfig.c lcd-pcf8574.c rc-switch.c dht11.c \ + logger.c +OBJS = xutil.o rdconfig.o lcd-pcf8574.o rc-switch.o dht11.o \ + logger.o HDRS = mbselib.h TARGET = libmbse.a @@ -49,4 +51,5 @@ lcd-pcf8574.o: ../config.h mbselib.h rc-switch.o: ../config.h mbselib.h dht11.o: ../config.h mbselib.h +logger.o: ../config.h mbselib.h # End of generated dependencies
--- a/lib/dht11.c Thu May 08 22:36:51 2014 +0200 +++ b/lib/dht11.c Fri May 09 20:39:01 2014 +0200 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2008-2014 + * Copyright (C) 2014 * * Michiel Broek <mbroek at mbse dot eu> *
--- a/lib/mbselib.h Thu May 08 22:36:51 2014 +0200 +++ b/lib/mbselib.h Fri May 09 20:39:01 2014 +0200 @@ -10,6 +10,8 @@ #include <ctype.h> #include <sys/types.h> #include <sys/stat.h> +#include <sys/time.h> +#include <time.h> #include <fcntl.h> #include <syslog.h> #include <unistd.h> @@ -102,6 +104,9 @@ int initLCD (int, int); +/* logger.c */ +void logger(char *, char *, char *); + /* rc-switch.c */
--- a/lib/rc-switch.c Thu May 08 22:36:51 2014 +0200 +++ b/lib/rc-switch.c Fri May 09 20:39:01 2014 +0200 @@ -958,8 +958,8 @@ static unsigned int repeatCount; - long time = micros(); - duration = time - lastTime; + long thistime = micros(); + duration = thistime - lastTime; if (duration > 5000 && duration > timings[0] - 200 && duration < timings[0] + 200) { repeatCount++; @@ -984,7 +984,7 @@ repeatCount = 0; } timings[changeCount++] = duration; - lastTime = time; + lastTime = thistime; }