thermferm/one-wire.c

changeset 674
6cabc02f4c8d
parent 672
0c2c66920d79
child 690
3a5b019e9acc
--- a/thermferm/one-wire.c	Thu Apr 11 15:01:46 2024 +0200
+++ b/thermferm/one-wire.c	Thu Apr 11 15:58:49 2024 +0200
@@ -142,7 +142,6 @@
 		n_w1->family[2] = '\0';
 		n_w1->present = DEVPRESENT_YES;
 		n_w1->value = (strcmp(w1type, (char *)"3a") == 0) ? 3:-1;
-//		n_w1->subdevices = (strcmp(w1type, (char *)"3a") == 0) ? 2:1;
 		n_w1->timestamp = time(NULL);
 
 		pthread_mutex_lock(&mutexes[LOCK_ONE_WIRE]);
@@ -209,7 +208,6 @@
 
     for (dev_w1 = w1_devices; dev_w1; dev_w1 = dev_w1->next) {
 	if (strcmp(dev_w1->family, "3a") == 0) {
-//	    syslog(LOG_NOTICE, "ds2413 %s", dev_w1->address);
 	    for (i = 0; i < 2; i++) {
 		for (device = Config.devices; device; device = device->next) {
 		    if ((strcmp(dev_w1->address, device->address) == 0) && (device->subdevice == i) && (device->direction == DEVDIR_IN_BIN)) {
@@ -272,15 +270,11 @@
 			    }
 
 			    if (output != newval) {
-				if ((rc = write_w1(dev_w1->address, (char *)"output", newval)) == 0) {
+				if ((write_w1(dev_w1->address, (char *)"output", newval)) == 0) {
 				    syslog(LOG_NOTICE, "One-wire device %s-%d out %02x -> %02x", dev_w1->address, i, output, newval);
 				    dev_w1->value = newval;
-				} else {
-				    syslog(LOG_NOTICE, "One-wire device %s-%d write output rc=%d", dev_w1->address, i, rc);
 				}
 			    }
-			} else {
-			    syslog(LOG_NOTICE, "One-wire device %s-%d read state rc=%d", dev_w1->address, i, rc);
 			}
 		    }
 		} /* for (device = Config.devices; ... */
@@ -303,7 +297,6 @@
 
 	if ((strcmp(cur_w1->family, (char *)"10") == 0) || (strcmp(cur_w1->family, (char *)"22") == 0) || (strcmp(cur_w1->family, (char *)"28") == 0) ||
 	    (strcmp(cur_w1->family, (char *)"3b") == 0) || (strcmp(cur_w1->family, (char *)"42") == 0)) {
-//	    syslog(LOG_NOTICE, "Reading %s", cur_w1->address);
 	    devfile = xstrcpy((char *)"/sys/bus/w1/devices/");
 	    devfile = xstrcat(devfile, cur_w1->address);
 	    devfile = xstrcat(devfile, (char *)"/resolution");
@@ -366,10 +359,8 @@
 		(strcmp(cur_w1->family, (char *)"3b") == 0) || (strcmp(cur_w1->family, (char *)"42") == 0))
 		break;
 	}
-//	syslog(LOG_NOTICE, "One-wire device %s next sensor %s", cur_w1->address, cur_w1->family);
 
     } else {
-//	syslog(LOG_NOTICE, "cur_w1 == NULL");
     	mDelay(750);
     }
 

mercurial