main/task_ds18b20.c

changeset 12
7dc9003f86a8
parent 10
d08c7466bb40
child 23
58a328e91881
--- a/main/task_ds18b20.c	Sun Oct 13 12:24:14 2019 +0200
+++ b/main/task_ds18b20.c	Sun Oct 13 19:27:12 2019 +0200
@@ -1,8 +1,7 @@
 /**
  * @file task_ds18b20.c
- * @brief The FreeRTOS task to query the DS18B20 sensors on one or two
- *        one-wire busses. Each bus must have only one sensor. That way
- *        we don't need to care about the DS18B20 internal ROM address.
+ * @brief The FreeRTOS task to query the DS18B20 sensors on the
+ *        one-wire bus. 
  *        The task will update the DS18B20_State structure.
  */
 
@@ -158,6 +157,8 @@
 		    }
 		    ds18b20_state->num_sensors = num_devices;
 		    xSemaphoreGive(xSemaphoreDS18B20);
+		} else {
+		    ESP_LOGE(TAG, "Missed lock 1");
 		}
 	    } else {
 
@@ -175,12 +176,13 @@
         	    ds18b20_state->sensor[i].error = DS18B20_ERR_READ;
 		}
 		xSemaphoreGive(xSemaphoreDS18B20);
+	    } else {
+		ESP_LOGE(TAG, "Missed lock 2");
 	    }
 	
 	    xEventGroupClearBits(xEventGroupDS18B20, TASK_DS18B20_REQUEST_TEMPS);
 	    xEventGroupSetBits(xEventGroupDS18B20, TASK_DS18B20_REQUEST_DONE);
 	}
-	vTaskDelay(10 / portTICK_PERIOD_MS);
     }
 }
 

mercurial