mirror of
https://github.com/adafruit/DHT-sensor-library.git
synced 2023-10-23 22:20:38 +03:00
Merge pull request #91 from chelmi/master
Fix for slower boards. Use uint16_t in expectPulse loop to increase sampling rate
This commit is contained in:
commit
07da1cd001
2
DHT.cpp
2
DHT.cpp
@ -243,7 +243,7 @@ bool DHT::read(bool force) {
|
|||||||
// in the very latest IDE versions):
|
// in the very latest IDE versions):
|
||||||
// https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/wiring_pulse.c
|
// https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/wiring_pulse.c
|
||||||
uint32_t DHT::expectPulse(bool level) {
|
uint32_t DHT::expectPulse(bool level) {
|
||||||
uint32_t count = 0;
|
uint16_t count = 0;
|
||||||
// On AVR platforms use direct GPIO port access as it's much faster and better
|
// On AVR platforms use direct GPIO port access as it's much faster and better
|
||||||
// for catching pulses that are 10's of microseconds in length:
|
// for catching pulses that are 10's of microseconds in length:
|
||||||
#ifdef __AVR
|
#ifdef __AVR
|
||||||
|
Loading…
Reference in New Issue
Block a user