# HG changeset patch # User Michiel Broek # Date 1405265505 -7200 # Node ID 1bd9a16f50614dcdd8489f30082fb2bddd37f83f # Parent a5a964148e3464ce5eb296a3e92672cfda744099 Added .h files diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/futil.c --- a/thermferm/futil.c Sat Jul 12 23:50:48 2014 +0200 +++ b/thermferm/futil.c Sun Jul 13 17:31:45 2014 +0200 @@ -21,6 +21,7 @@ *****************************************************************************/ #include "thermferm.h" +#include "futil.h" /* diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/futil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermferm/futil.h Sun Jul 13 17:31:45 2014 +0200 @@ -0,0 +1,7 @@ +#ifndef FUTIL_H +#define FUTIL_H + + +int mkdirs(char *, mode_t); + +#endif diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/lcd-buffer.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermferm/lcd-buffer.c Sun Jul 13 17:31:45 2014 +0200 @@ -0,0 +1,31 @@ +/***************************************************************************** + * Copyright (C) 2008-2014 + * + * Michiel Broek + * + * This file is part of the mbsePi-apps + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * mbsePi-apps is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with mbsePi-apps; see the file COPYING. If not, write to the Free + * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + *****************************************************************************/ + +#include "thermferm.h" +#include "lcd-buffer.h" + +#ifdef HAVE_WIRINGPI_H + + + + +#endif diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/lcd-buffer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermferm/lcd-buffer.h Sun Jul 13 17:31:45 2014 +0200 @@ -0,0 +1,6 @@ +#ifndef LCD_BUFFER_H +#define LCD_BUFFER_H + + + +#endif diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/lcd-pcf8574.c --- a/thermferm/lcd-pcf8574.c Sat Jul 12 23:50:48 2014 +0200 +++ b/thermferm/lcd-pcf8574.c Sun Jul 13 17:31:45 2014 +0200 @@ -24,6 +24,8 @@ */ #include "thermferm.h" +#include "lcd-pcf8574.h" + #ifdef HAVE_WIRINGPI_H diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/lcd-pcf8574.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermferm/lcd-pcf8574.h Sun Jul 13 17:31:45 2014 +0200 @@ -0,0 +1,27 @@ +#ifndef LCD_PCF8574_H +#define LCD_PCF8574_H + + +#ifdef HAVE_WIRINGPI_H + +// Defines for the pcf8574 Pi LCD interface board +#define AF_BASE 100 + +#define AF_RS (AF_BASE + 0) +#define AF_RW (AF_BASE + 1) +#define AF_E (AF_BASE + 2) +#define AF_BACKLIGHT (AF_BASE + 3) +#define AF_DB4 (AF_BASE + 4) +#define AF_DB5 (AF_BASE + 5) +#define AF_DB6 (AF_BASE + 6) +#define AF_DB7 (AF_BASE + 7) + +void setBacklight (int); +int initLCD (int, int); +void mb_lcdPutchar(const int, unsigned char); +void mb_lcdPuts(const int, const char *); +void mb_lcdClear(const int); + +#endif + +#endif diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/lock.c --- a/thermferm/lock.c Sat Jul 12 23:50:48 2014 +0200 +++ b/thermferm/lock.c Sun Jul 13 17:31:45 2014 +0200 @@ -20,6 +20,7 @@ * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *****************************************************************************/ +#include "lock.h" #include "thermferm.h" /* diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/lock.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermferm/lock.h Sun Jul 13 17:31:45 2014 +0200 @@ -0,0 +1,8 @@ +#ifndef LOCK_H +#define LOCK_H + + +int lockprog(char *); +void ulockprog(char *); + +#endif diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/logger.c --- a/thermferm/logger.c Sat Jul 12 23:50:48 2014 +0200 +++ b/thermferm/logger.c Sun Jul 13 17:31:45 2014 +0200 @@ -20,7 +20,10 @@ * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *****************************************************************************/ +#include "logger.h" #include "thermferm.h" +#include "futil.h" +#include "xutil.h" void logger(char *filename, char *data) diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/logger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermferm/logger.h Sun Jul 13 17:31:45 2014 +0200 @@ -0,0 +1,7 @@ +#ifndef LOGGER_H +#define LOGGER_H + + +void logger(char *, char *); + +#endif diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/rdconfig.c --- a/thermferm/rdconfig.c Sat Jul 12 23:50:48 2014 +0200 +++ b/thermferm/rdconfig.c Sun Jul 13 17:31:45 2014 +0200 @@ -20,8 +20,10 @@ * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *****************************************************************************/ +#include "rdconfig.h" #include "thermferm.h" - +#include "futil.h" +#include "xutil.h" int debug = FALSE; static char *mypath; diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/sensors.c --- a/thermferm/sensors.c Sat Jul 12 23:50:48 2014 +0200 +++ b/thermferm/sensors.c Sun Jul 13 17:31:45 2014 +0200 @@ -20,7 +20,9 @@ * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *****************************************************************************/ +#include "sensors.h" #include "thermferm.h" +#include "xutil.h" extern int debug; diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/sensors.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermferm/sensors.h Sun Jul 13 17:31:45 2014 +0200 @@ -0,0 +1,11 @@ +#ifndef SENSORS_H +#define SENSORS_H + + +#ifdef HAVE_WIRINGPI_H +PI_THREAD (my_sensors_loop); +#else +void *my_sensors_loop(void *); +#endif + +#endif diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/server.c --- a/thermferm/server.c Sat Jul 12 23:50:48 2014 +0200 +++ b/thermferm/server.c Sun Jul 13 17:31:45 2014 +0200 @@ -20,7 +20,10 @@ * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *****************************************************************************/ +#include "rdconfig.h" #include "thermferm.h" +#include "server.h" +#include "xutil.h" extern int my_shutdown; diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/server.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermferm/server.h Sun Jul 13 17:31:45 2014 +0200 @@ -0,0 +1,12 @@ +#ifndef SERVER_H +#define SERVER_H + + +#ifdef HAVE_WIRINGPI_H +PI_THREAD (my_server_loop); +#else +void *my_server_loop(void *); +#endif + + +#endif diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/thermferm.c --- a/thermferm/thermferm.c Sat Jul 12 23:50:48 2014 +0200 +++ b/thermferm/thermferm.c Sun Jul 13 17:31:45 2014 +0200 @@ -20,7 +20,17 @@ * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *****************************************************************************/ +#include "lock.h" +#include "logger.h" +#include "rdconfig.h" +#include "sensors.h" +#include "server.h" #include "thermferm.h" +#include "lcd-pcf8574.h" +#include "lcd-buffer.h" +#include "futil.h" +#include "units.h" +#include "xutil.h" int current_unit = -1; diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/thermferm.h --- a/thermferm/thermferm.h Sat Jul 12 23:50:48 2014 +0200 +++ b/thermferm/thermferm.h Sun Jul 13 17:31:45 2014 +0200 @@ -163,71 +163,5 @@ } sys_config; -void killconfig(void); -int rdconfig(void); -int wrconfig(void); - - -/* lock.c */ -int lockprog(char *); -void ulockprog(char *); - - -/* xutil.c */ -char *xmalloc(size_t); -char *xstrcpy(char *); -char *xstrcat(char *, char *); - - -/* futil.c */ -int mkdirs(char *, mode_t); - - -#ifdef HAVE_WIRINGPI_H - -/* lcd-pcf8574.c */ -// Defines for the pcf8574 Pi LCD interface board -#define AF_BASE 100 - -#define AF_RS (AF_BASE + 0) -#define AF_RW (AF_BASE + 1) -#define AF_E (AF_BASE + 2) -#define AF_BACKLIGHT (AF_BASE + 3) -#define AF_DB4 (AF_BASE + 4) -#define AF_DB5 (AF_BASE + 5) -#define AF_DB6 (AF_BASE + 6) -#define AF_DB7 (AF_BASE + 7) - -void setBacklight (int); -int initLCD (int, int); -void mb_lcdPutchar(const int, unsigned char); -void mb_lcdPuts(const int, const char *); -void mb_lcdClear(const int); #endif - -/* logger.c */ -void logger(char *, char *); - -#ifdef HAVE_WIRINGPI_H -PI_THREAD (my_sensors_loop); -#else -void *my_sensors_loop(void *); -#endif - -/* server.c */ -#ifdef HAVE_WIRINGPI_H -PI_THREAD (my_server_loop); -#else -void *my_server_loop(void *); -#endif - -#ifdef HAVE_WIRINGPI_H -PI_THREAD (my_units_loop); -#else -void *my_units_loop(void *); -#endif - - -#endif - diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/units.c --- a/thermferm/units.c Sat Jul 12 23:50:48 2014 +0200 +++ b/thermferm/units.c Sun Jul 13 17:31:45 2014 +0200 @@ -21,6 +21,8 @@ *****************************************************************************/ #include "thermferm.h" +#include "units.h" +#include "xutil.h" extern int debug; diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/units.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermferm/units.h Sun Jul 13 17:31:45 2014 +0200 @@ -0,0 +1,11 @@ +#ifndef UNITS_H +#define UNITS_H + + +#ifdef HAVE_WIRINGPI_H +PI_THREAD (my_units_loop); +#else +void *my_units_loop(void *); +#endif + +#endif diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/xutil.c --- a/thermferm/xutil.c Sat Jul 12 23:50:48 2014 +0200 +++ b/thermferm/xutil.c Sun Jul 13 17:31:45 2014 +0200 @@ -21,6 +21,7 @@ *****************************************************************************/ #include "thermferm.h" +#include "xutil.h" char *xmalloc(size_t size) diff -r a5a964148e34 -r 1bd9a16f5061 thermferm/xutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thermferm/xutil.h Sun Jul 13 17:31:45 2014 +0200 @@ -0,0 +1,8 @@ +#ifndef XUTIL_H +#define XUTIL_H + +char *xmalloc(size_t); +char *xstrcpy(char *); +char *xstrcat(char *, char *); + +#endif