main/task_ds18b20.c

changeset 55
43362bb8f3c0
parent 44
e52d11b8f252
child 57
232f318a6b51
equal deleted inserted replaced
54:3b1834482899 55:43362bb8f3c0
21 21
22 SemaphoreHandle_t xSemaphoreDS18B20 = NULL; ///< Semaphire DS18B20 task 22 SemaphoreHandle_t xSemaphoreDS18B20 = NULL; ///< Semaphire DS18B20 task
23 EventGroupHandle_t xEventGroupDS18B20; ///< Events DS18B20 task 23 EventGroupHandle_t xEventGroupDS18B20; ///< Events DS18B20 task
24 DS18B20_State *ds18b20_state; ///< Public state for other tasks 24 DS18B20_State *ds18b20_state; ///< Public state for other tasks
25 25
26 extern uint32_t err_temp;
26 27
27 const int TASK_DS18B20_REQUEST_TEMPS = BIT0; ///< Request temperature measurements 28 const int TASK_DS18B20_REQUEST_TEMPS = BIT0; ///< Request temperature measurements
28 const int TASK_DS18B20_REQUEST_DONE = BIT1; ///< Request is completed 29 const int TASK_DS18B20_REQUEST_DONE = BIT1; ///< Request is completed
29 30
30 31
144 ds18b20_state->sensor[i].error = DS18B20_ERR_CRC; 145 ds18b20_state->sensor[i].error = DS18B20_ERR_CRC;
145 else 146 else
146 ds18b20_state->sensor[i].error = DS18B20_ERR_READ; // All other errors 147 ds18b20_state->sensor[i].error = DS18B20_ERR_READ; // All other errors
147 ds18b20_state->valid = false; 148 ds18b20_state->valid = false;
148 ds18b20_state->sensor[i].temperature = 0.0; 149 ds18b20_state->sensor[i].temperature = 0.0;
150 err_temp++;
149 } else if (readings[i] == 85.0) { // Error value 151 } else if (readings[i] == 85.0) { // Error value
150 ds18b20_state->sensor[i].error = DS18B20_ERR_READ; 152 ds18b20_state->sensor[i].error = DS18B20_ERR_READ;
151 ds18b20_state->valid = false; 153 ds18b20_state->valid = false;
152 ds18b20_state->sensor[i].temperature = 0.0; 154 ds18b20_state->sensor[i].temperature = 0.0;
155 err_temp++;
153 } else { 156 } else {
154 ds18b20_state->sensor[i].error = DS18B20_ERR_NONE; 157 ds18b20_state->sensor[i].error = DS18B20_ERR_NONE;
155 ds18b20_state->sensor[i].temperature = readings[i]; 158 ds18b20_state->sensor[i].temperature = readings[i];
156 } 159 }
157 #if 1 160 #if 1

mercurial