Cleanedup code and added some logging
I think the averaging is working - will need to check the 10 minutes
This commit is contained in:
@@ -76,10 +76,7 @@ dht22_error dht22_read() {
|
||||
if (elapsed_time == DHT22_TIMEOUT_ERROR) {
|
||||
portENABLE_INTERRUPTS();
|
||||
return DHT22_TIMEOUT_ERROR;
|
||||
} /*else if (elapsed_time > 50) {
|
||||
portENABLE_INTERRUPTS();
|
||||
return DHT22_TIMING_ERROR;
|
||||
}*/
|
||||
}
|
||||
|
||||
/*
|
||||
* From datasheet:
|
||||
@@ -91,19 +88,13 @@ dht22_error dht22_read() {
|
||||
if (elapsed_time == DHT22_TIMEOUT_ERROR) {
|
||||
portENABLE_INTERRUPTS();
|
||||
return DHT22_TIMEOUT_ERROR;
|
||||
} /*else if (elapsed_time < 50 || elapsed_time > 110) {
|
||||
portENABLE_INTERRUPTS();
|
||||
return DHT22_TIMING_ERROR;
|
||||
}*/
|
||||
}
|
||||
|
||||
elapsed_time = wait_for_signal_to_change_from(1);
|
||||
if (elapsed_time == DHT22_TIMEOUT_ERROR) {
|
||||
portENABLE_INTERRUPTS();
|
||||
return DHT22_TIMEOUT_ERROR;
|
||||
} /*else if (elapsed_time < 50 || elapsed_time > 110) {
|
||||
portENABLE_INTERRUPTS();
|
||||
return DHT22_TIMING_ERROR;
|
||||
}*/
|
||||
}
|
||||
|
||||
/*
|
||||
* From datasheet:
|
||||
|
||||
Reference in New Issue
Block a user