Skip to content

Commit

Permalink
drivers/dht: busy wait reimplementation
Browse files Browse the repository at this point in the history
- many backports from @maribu's IRQ based implementation (RIOT-OS#18591)
- use of ztimer and errno.h
- separation of dht_read() steps into functions for better readability
- reintroduction of DHT11/DHT22 differentiation
- sensor presence checking in dht_init()
- default input mode changed to open drain
- AVR support without platform-specific handling by avoiding
  ztimer_spin() and using the overflow of an 8-bit variable as a
  pre-timeout to minimize time-consuming ztimer_now() calls
- add a new DHT11_2022 type for 0.01 °C resolution devices
- data caching removed
  • Loading branch information
hugueslarrive committed Jun 20, 2023
1 parent 84a3078 commit 4c54154
Show file tree
Hide file tree
Showing 8 changed files with 248 additions and 158 deletions.
2 changes: 1 addition & 1 deletion drivers/dht/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ config MODULE_DHT
depends on HAS_PERIPH_GPIO
depends on TEST_KCONFIG
select MODULE_PERIPH_GPIO
select MODULE_XTIMER
select ZTIMER_USEC

config HAVE_DHT
bool
Expand Down
2 changes: 1 addition & 1 deletion drivers/dht/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
USEMODULE += xtimer
USEMODULE += ztimer_usec
FEATURES_REQUIRED += periph_gpio
Loading

0 comments on commit 4c54154

Please sign in to comment.