Which I think the test logic would translate to...
If the count is less than 19.2us or greater than 80us then it's a bad read.
Otherwise if the count is greater than 49.6us and less than 80us the bit is a 1.
that's it although a '0' is 26-28uS and a 1 is 70us according to the data sheet I have added some tolerance (this helps if interrupts are involved) if the count is outside this range then its not right and the process is abandoned , this test is not strictly necessary and could be omitted

the 1/0 test is basically centered in between the 1 and the 0 times ie 50 is halfway between 30 and 70 once again to add some tolerance . if less than halfway its a 0 otherwise a 1


there is some risk in this method in that hangs are possible if the dht responds in an unforseen manner . in my production version the tmrx int is enabled and if it is triggered then the process is also aborted to recover from such a sensor hang .