thermferm/thermferm.c

changeset 652
16d3d4b58b5b
parent 651
da166cb8470f
child 654
e981d0185485
equal deleted inserted replaced
651:da166cb8470f 652:16d3d4b58b5b
23 #include "lock.h" 23 #include "lock.h"
24 #include "rdconfig.h" 24 #include "rdconfig.h"
25 #include "devices.h" 25 #include "devices.h"
26 #include "server.h" 26 #include "server.h"
27 #include "thermferm.h" 27 #include "thermferm.h"
28 #include "delay.h"
28 #include "simulator.h" 29 #include "simulator.h"
29 #include "lcd-pcf8574.h" 30 #include "lcd-pcf8574.h"
30 #include "lcd-buffer.h" 31 #include "lcd-buffer.h"
31 #include "slcd.h" 32 #include "slcd.h"
32 #include "panel.h" 33 #include "panel.h"
1126 */ 1127 */
1127 if (run_pause) { 1128 if (run_pause) {
1128 run_hold = TRUE; 1129 run_hold = TRUE;
1129 syslog(LOG_NOTICE, "run_pause: entering hold state"); 1130 syslog(LOG_NOTICE, "run_pause: entering hold state");
1130 for (;;) { 1131 for (;;) {
1131 usleep(100000); 1132 mDelay(100);
1132 if (! run_pause) 1133 if (! run_pause)
1133 break; 1134 break;
1134 } 1135 }
1135 syslog(LOG_NOTICE, "run_pause: leaving hold state"); 1136 syslog(LOG_NOTICE, "run_pause: leaving hold state");
1136 run_hold = FALSE; 1137 run_hold = FALSE;
1175 } else if (rc == DEVPRESENT_ERROR) { 1176 } else if (rc == DEVPRESENT_ERROR) {
1176 Config.temp_state = 1; 1177 Config.temp_state = 1;
1177 } else { 1178 } else {
1178 Config.temp_state = 2; 1179 Config.temp_state = 2;
1179 } 1180 }
1180 usleep(10000); 1181 mDelay(10);
1181 } 1182 }
1182 row++; 1183 row++;
1183 1184
1184 pthread_mutex_lock(&mutexes[LOCK_LCD]); 1185 pthread_mutex_lock(&mutexes[LOCK_LCD]);
1185 lcd_buf_write(row, " Humidity N/A "); 1186 lcd_buf_write(row, " Humidity N/A ");
1198 } else if (rc == DEVPRESENT_ERROR) { 1199 } else if (rc == DEVPRESENT_ERROR) {
1199 Config.hum_state = 1; 1200 Config.hum_state = 1;
1200 } else { 1201 } else {
1201 Config.hum_state = 2; 1202 Config.hum_state = 2;
1202 } 1203 }
1203 usleep(10000); 1204 mDelay(10);
1204 } 1205 }
1205 row++; 1206 row++;
1206 /* 1207 /*
1207 * If TH(B) changed. or if 5 minutes without 1208 * If TH(B) changed. or if 5 minutes without
1208 * update, send the NDATA message. 1209 * update, send the NDATA message.
1874 slcdDummy(slcdHandle); 1875 slcdDummy(slcdHandle);
1875 key = keycheck(); 1876 key = keycheck();
1876 if (key != KEY_NONE) 1877 if (key != KEY_NONE)
1877 panel_key_events(key); 1878 panel_key_events(key);
1878 1879
1879 usleep(100000); 1880 mDelay(100);
1880 1881
1881 } while (run); 1882 } while (run);
1882 1883
1883 /* 1884 /*
1884 * Stop units processing in a neat way 1885 * Stop units processing in a neat way

mercurial