# HG changeset patch # User Michiel Broek # Date 1448574768 -3600 # Node ID 4df9ae3095f8cf5afcfedb29d0df8ef77d68b7ba # Parent 4b1ed6897d80f3ba2c779001c70ba181d2560073 Fixed compiling with wiringPi diff -r 4b1ed6897d80 -r 4df9ae3095f8 brewco/devices.c --- a/brewco/devices.c Thu Nov 26 22:47:42 2015 +0100 +++ b/brewco/devices.c Thu Nov 26 22:52:48 2015 +0100 @@ -23,6 +23,7 @@ #include "brewco.h" #include "devices.h" #include "xutil.h" +#include "keyboard.h" extern int debug; @@ -136,10 +137,6 @@ devices_list *device; time_t now, my_timestamp; int rc, my_value, test_value; -#ifdef HAVE_WIRINGPI_H - int i; - char buf[40]; -#endif if (uuid == NULL) return 0; @@ -170,25 +167,6 @@ #ifdef HAVE_WIRINGPI_H rc = 0; - if ((device->type == DEVTYPE_RC433) && (device->gpiopin != -1) && (device->present == DEVPRESENT_YES)) { - snprintf(buf, 39, "%s,%d", device->address, value ? 1:0); - for (i = 0; i < strlen(buf); i++) - if (buf[i] == '-') - buf[i] = ','; - piUnlock(LOCK_DEVICES); - enableTransmit(device->gpiopin); - rc = toggleSwitch(buf); - disableTransmit(); - piLock(LOCK_DEVICES); - syslog(LOG_NOTICE, "RC433 command %s rc=%d", buf, rc); - if (debug) - fprintf(stdout, "RC433 command %s rc=%d\n", buf, rc); - device->value = value; - device->timestamp = time(NULL); - piUnlock(LOCK_DEVICES); - return rc; - } - if ((device->type == DEVTYPE_GPIO) && (device->gpiopin != -1) && (device->present == DEVPRESENT_YES)) { } @@ -593,9 +571,6 @@ char *addr = NULL, line[60], *p = NULL; FILE *fp; int temp, rc; -#ifdef HAVE_WIRINGPI_H - time_t now; -#endif syslog(LOG_NOTICE, "Thread my_devices_loop started");