From a1f0c1c0389fdea7d675d435502c07bca3a2ac5a Mon Sep 17 00:00:00 2001 From: Tom Petz Date: Tue, 8 Sep 2020 13:57:07 -0400 Subject: [PATCH 1/4] Add missing microsecondsToClockCycles for 33 BLE --- DHT.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DHT.h b/DHT.h index c2b51e0..04849af 100644 --- a/DHT.h +++ b/DHT.h @@ -47,6 +47,13 @@ #define DHT21 21 /**< DHT TYPE 21 */ #define AM2301 21 /**< AM2301 */ +#if (TARGET_NAME==ARDUINO_NANO33BLE) +// As of 7 Sep 2020 the Arduino Nano 33 BLE boards do not have microsecondsToClockCycles defined. +#ifndef microsecondsToClockCycles +#define microsecondsToClockCycles(a) ( (a) * (SystemCoreClock / 1000000L) ) +#endif +#endif + /*! * @brief Class that stores state and functions for DHT */ From fa22bc6ca4ce9f5f8911400267e762cecd524e98 Mon Sep 17 00:00:00 2001 From: Tom Petz Date: Tue, 8 Sep 2020 14:41:40 -0400 Subject: [PATCH 2/4] Fix lint errors --- DHT.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DHT.h b/DHT.h index 04849af..17856ad 100644 --- a/DHT.h +++ b/DHT.h @@ -47,10 +47,11 @@ #define DHT21 21 /**< DHT TYPE 21 */ #define AM2301 21 /**< AM2301 */ -#if (TARGET_NAME==ARDUINO_NANO33BLE) -// As of 7 Sep 2020 the Arduino Nano 33 BLE boards do not have microsecondsToClockCycles defined. +#if (TARGET_NAME == ARDUINO_NANO33BLE) +// As of 7 Sep 2020 the Arduino Nano 33 BLE boards do not have +// microsecondsToClockCycles defined. #ifndef microsecondsToClockCycles -#define microsecondsToClockCycles(a) ( (a) * (SystemCoreClock / 1000000L) ) +#define microsecondsToClockCycles(a) ((a) * (SystemCoreClock / 1000000L)) #endif #endif From b504fa540e1a45be7b27343dceb8701edbde8c91 Mon Sep 17 00:00:00 2001 From: Tom Petz Date: Tue, 8 Sep 2020 14:48:08 -0400 Subject: [PATCH 3/4] fix extra space and end of line --- DHT.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DHT.h b/DHT.h index 17856ad..9e8e021 100644 --- a/DHT.h +++ b/DHT.h @@ -48,7 +48,7 @@ #define AM2301 21 /**< AM2301 */ #if (TARGET_NAME == ARDUINO_NANO33BLE) -// As of 7 Sep 2020 the Arduino Nano 33 BLE boards do not have +// As of 7 Sep 2020 the Arduino Nano 33 BLE boards do not have // microsecondsToClockCycles defined. #ifndef microsecondsToClockCycles #define microsecondsToClockCycles(a) ((a) * (SystemCoreClock / 1000000L)) From f0a66b0dd317359fed052cd5242ba028de1bfb22 Mon Sep 17 00:00:00 2001 From: Tom Petz Date: Tue, 8 Sep 2020 16:12:02 -0400 Subject: [PATCH 4/4] Adjust comments to comply with doxygen. --- DHT.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DHT.h b/DHT.h index 9e8e021..c3ab67f 100644 --- a/DHT.h +++ b/DHT.h @@ -48,9 +48,11 @@ #define AM2301 21 /**< AM2301 */ #if (TARGET_NAME == ARDUINO_NANO33BLE) -// As of 7 Sep 2020 the Arduino Nano 33 BLE boards do not have -// microsecondsToClockCycles defined. #ifndef microsecondsToClockCycles +/*! + * As of 7 Sep 2020 the Arduino Nano 33 BLE boards do not have + * microsecondsToClockCycles defined. + */ #define microsecondsToClockCycles(a) ((a) * (SystemCoreClock / 1000000L)) #endif #endif