thermferm/thermferm.c

changeset 245
b01b6238eb67
parent 244
2f868eaefec2
child 246
6df404da3537
equal deleted inserted replaced
244:2f868eaefec2 245:b01b6238eb67
33 #include "xutil.h" 33 #include "xutil.h"
34 34
35 35
36 int my_shutdown = FALSE; 36 int my_shutdown = FALSE;
37 static pid_t pgrp, mypid; 37 static pid_t pgrp, mypid;
38 int run_pause = FALSE;
39 int run_hold = FALSE;
38 40
39 extern int debug; 41 extern int debug;
40 extern sys_config Config; 42 extern sys_config Config;
41 #ifdef HAVE_WIRINGPI_H 43 #ifdef HAVE_WIRINGPI_H
42 extern int lcdHandle; 44 extern int lcdHandle;
497 } 499 }
498 500
499 do { 501 do {
500 if (my_shutdown) 502 if (my_shutdown)
501 run = 0; 503 run = 0;
504
505 /*
506 * Use to stop processing units. Should be used when a unit is
507 * added or removed.
508 */
509 if (run_pause) {
510 run_hold = TRUE;
511 syslog(LOG_NOTICE, "run_pause: entering hold state");
512 for (;;) {
513 usleep(100000);
514 if (! run_pause)
515 break;
516 }
517 syslog(LOG_NOTICE, "run_pause: leaving hold state");
518 run_hold = FALSE;
519 #ifdef HAVE_WIRINGPI_H
520 /*
521 * In case the LCD buffers were cleared, setup the first page.
522 */
523 piLock(LOCK_LCD);
524 lcd_buf_write(1, (char *)" ThermFerm ");
525 lcd_buf_write(2, (char *)" Version %s ", VERSION);
526 piUnlock(LOCK_LCD);
527 #endif
528 }
502 529
503 now = time(NULL); 530 now = time(NULL);
504 if (now != last) { 531 if (now != last) {
505 /* 532 /*
506 * Each second 533 * Each second

mercurial