mirror of
https://github.com/niesteszeck/idDHT11.git
synced 2025-03-15 04:27:29 +03:00
mod to the response timing
This commit is contained in:
parent
ac5c661b2d
commit
c13b5732b8
@ -68,9 +68,10 @@ void idDHT11::isrCallback() {
|
|||||||
}
|
}
|
||||||
switch(state) {
|
switch(state) {
|
||||||
case RESPONSE:
|
case RESPONSE:
|
||||||
if(delta<25)
|
if(delta<25){
|
||||||
return; //do nothing, it started the response signal
|
us -= delta;
|
||||||
if(125<delta && delta<170) {
|
break; //do nothing, it started the response signal
|
||||||
|
} if(125<delta && delta<190) {
|
||||||
state = DATA;
|
state = DATA;
|
||||||
} else {
|
} else {
|
||||||
detachInterrupt(intNumber);
|
detachInterrupt(intNumber);
|
||||||
@ -83,7 +84,6 @@ void idDHT11::isrCallback() {
|
|||||||
detachInterrupt(intNumber);
|
detachInterrupt(intNumber);
|
||||||
status = IDDHTLIB_ERROR_DELTA;
|
status = IDDHTLIB_ERROR_DELTA;
|
||||||
state = STOPPED;
|
state = STOPPED;
|
||||||
// return;
|
|
||||||
} else if(60<delta && delta<135) { //valid in timing
|
} else if(60<delta && delta<135) { //valid in timing
|
||||||
if(delta>90) //is a one
|
if(delta>90) //is a one
|
||||||
bits[idx] |= (1 << cnt);
|
bits[idx] |= (1 << cnt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user