From 9d309b1cfde8d057caf52f18ee32e546d4150057 Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Wed, 1 Jun 2022 22:51:47 +0200 Subject: [PATCH 1/2] fix issue for SAMD21G18A (Wio terminal) --- dht_nonblocking.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dht_nonblocking.h b/dht_nonblocking.h index eeacb65..c962484 100644 --- a/dht_nonblocking.h +++ b/dht_nonblocking.h @@ -33,6 +33,12 @@ #define DHT_TYPE_21 1 #define DHT_TYPE_22 2 +#if defined(SAMD21G18A) +#define REGTYPE PortGroup* +#else# +#define REGTYPE uint8_t //UNO & other AVR processors, use 8 bit registers +#endif + class DHT_nonblocking { @@ -49,7 +55,8 @@ class DHT_nonblocking uint8_t dht_state; unsigned long dht_timestamp; uint8_t data[ 6 ]; - const uint8_t _pin, _type, _bit, _port; + const uint8_t _pin, _type, _bit; + REGTYPE _port; const uint32_t _maxcycles; uint32_t expect_pulse( bool level ) const; From ec6e5b9e89614aa51b20a047e5181d07a4829294 Mon Sep 17 00:00:00 2001 From: Hpsaturn Date: Fri, 24 Jun 2022 09:46:35 +0200 Subject: [PATCH 2/2] fixed issue in pre-compiling directive --- dht_nonblocking.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dht_nonblocking.h b/dht_nonblocking.h index c962484..2042fdd 100644 --- a/dht_nonblocking.h +++ b/dht_nonblocking.h @@ -35,7 +35,7 @@ #if defined(SAMD21G18A) #define REGTYPE PortGroup* -#else# +#else #define REGTYPE uint8_t //UNO & other AVR processors, use 8 bit registers #endif