4 Commits
1.4.3 ... 1.4.5

Author SHA1 Message Date
be6915c60d Update CI action versions 2023-05-12 11:24:12 -04:00
b2be3b193b Bump to 1.4.4 2022-06-27 14:05:27 -04:00
5273ef06a8 Merge pull request #191 from ondras12345/unknown-F_CPU
Fix infinite loop on STM32F103
2022-06-25 21:18:53 -04:00
2470b8a3a1 Fix infinite loop on STM32F103
When trying to read temperature from a DHT11 when the sensor was
disconnected, the program would encounter an infinite loop in
DHT::expectPulse, because count would keep overflowing.
2022-06-25 19:46:56 +02:00
3 changed files with 7 additions and 5 deletions

View File

@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v1
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: adafruit/ci-arduino
path: ci

View File

@ -360,7 +360,9 @@ bool DHT::read(bool force) {
// in the very latest IDE versions):
// https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/wiring_pulse.c
uint32_t DHT::expectPulse(bool level) {
#if (F_CPU > 16000000L)
// F_CPU is not be known at compile time on platforms such as STM32F103.
// The preprocessor seems to evaluate it to zero in that case.
#if (F_CPU > 16000000L) || (F_CPU == 0L)
uint32_t count = 0;
#else
uint16_t count = 0; // To work fast enough on slower AVR boards

View File

@ -1,5 +1,5 @@
name=DHT sensor library
version=1.4.3
version=1.4.4
author=Adafruit
maintainer=Adafruit <info@adafruit.com>
sentence=Arduino library for DHT11, DHT22, etc Temp & Humidity Sensors