thermferm/devices.c

changeset 583
9795a16de807
parent 573
479878d528f2
child 584
ff7f038fae2f
equal deleted inserted replaced
582:ba340e00aab2 583:9795a16de807
384 } else { 384 } else {
385 #ifdef HAVE_WIRINGPI_H 385 #ifdef HAVE_WIRINGPI_H
386 piUnlock(LOCK_DEVICES); 386 piUnlock(LOCK_DEVICES);
387 #endif 387 #endif
388 return 0; 388 return 0;
389 } 389 } // if ((test_value != my_value) || (((int)now - (int)my_timestamp) >= 120))
390 } 390 } // if (! strcmp(uuid, device->uuid))
391 } 391 } // for (device = Config.devices; device; device = device->next)
392 #ifdef HAVE_WIRINGPI_H 392 #ifdef HAVE_WIRINGPI_H
393 piUnlock(LOCK_DEVICES); 393 piUnlock(LOCK_DEVICES);
394 #endif 394 #endif
395 395
396 return 0; 396 return 0;
727 #endif 727 #endif
728 728
729 syslog(LOG_NOTICE, "Thread my_devices_loop started"); 729 syslog(LOG_NOTICE, "Thread my_devices_loop started");
730 730
731 #ifdef HAVE_WIRINGPI_H 731 #ifdef HAVE_WIRINGPI_H
732 if ((rc = piHiPri(10))) 732 if ((rc = piHiPri(50)))
733 syslog(LOG_NOTICE, "my_devices_loop: piHiPri(10) rc=%d", rc); 733 syslog(LOG_NOTICE, "my_devices_loop: piHiPri(50) rc=%d", rc);
734 #endif 734 #endif
735 735
736 /* 736 /*
737 * Loop forever until the external shutdown variable is set. 737 * Loop forever until the external shutdown variable is set.
738 */ 738 */
795 device->timestamp = time(NULL); 795 device->timestamp = time(NULL);
796 device->present = DEVPRESENT_YES; 796 device->present = DEVPRESENT_YES;
797 #ifdef HAVE_WIRINGPI_H 797 #ifdef HAVE_WIRINGPI_H
798 piUnlock(LOCK_DEVICES); 798 piUnlock(LOCK_DEVICES);
799 #endif 799 #endif
800 }
801 if ((temp == 85000) || (temp < -125000)) {
802 syslog(LOG_NOTICE, "sensor %s value error '%d`", device->address, temp);
803 }
804 if (temp & 0xf800) {
805 syslog(LOG_NOTICE, "sensor %s sign bits error", device->address);
800 } 806 }
801 } else { 807 } else {
802 syslog(LOG_NOTICE, "sensor %s CRC error '%s`", device->address, line1); 808 syslog(LOG_NOTICE, "sensor %s CRC error '%s`", device->address, line1);
803 #ifdef HAVE_WIRINGPI_H 809 #ifdef HAVE_WIRINGPI_H
804 piLock(LOCK_DEVICES); 810 piLock(LOCK_DEVICES);

mercurial