156 ds18b20_state->sensor[i].temperature, dsErrors[ds18b20_state->sensor[i].error]); |
155 ds18b20_state->sensor[i].temperature, dsErrors[ds18b20_state->sensor[i].error]); |
157 #endif |
156 #endif |
158 } |
157 } |
159 ds18b20_state->num_sensors = num_devices; |
158 ds18b20_state->num_sensors = num_devices; |
160 xSemaphoreGive(xSemaphoreDS18B20); |
159 xSemaphoreGive(xSemaphoreDS18B20); |
|
160 } else { |
|
161 ESP_LOGE(TAG, "Missed lock 1"); |
161 } |
162 } |
162 } else { |
163 } else { |
163 |
164 |
164 ESP_LOGW(TAG, "No temperature sensors found."); |
165 ESP_LOGW(TAG, "No temperature sensors found."); |
165 } |
166 } |
173 ds18b20_state->sensor[i].temperature = 0.0; |
174 ds18b20_state->sensor[i].temperature = 0.0; |
174 ds18b20_state->sensor[i].rom_code[0] = '\0'; |
175 ds18b20_state->sensor[i].rom_code[0] = '\0'; |
175 ds18b20_state->sensor[i].error = DS18B20_ERR_READ; |
176 ds18b20_state->sensor[i].error = DS18B20_ERR_READ; |
176 } |
177 } |
177 xSemaphoreGive(xSemaphoreDS18B20); |
178 xSemaphoreGive(xSemaphoreDS18B20); |
|
179 } else { |
|
180 ESP_LOGE(TAG, "Missed lock 2"); |
178 } |
181 } |
179 |
182 |
180 xEventGroupClearBits(xEventGroupDS18B20, TASK_DS18B20_REQUEST_TEMPS); |
183 xEventGroupClearBits(xEventGroupDS18B20, TASK_DS18B20_REQUEST_TEMPS); |
181 xEventGroupSetBits(xEventGroupDS18B20, TASK_DS18B20_REQUEST_DONE); |
184 xEventGroupSetBits(xEventGroupDS18B20, TASK_DS18B20_REQUEST_DONE); |
182 } |
185 } |
183 vTaskDelay(10 / portTICK_PERIOD_MS); |
|
184 } |
186 } |
185 } |
187 } |
186 |
188 |