3 Commits
1.4.0 ... 1.4.1

Author SHA1 Message Date
61ffee54ba Bump to 1.4.1 2020-12-02 11:37:29 -05:00
cfaa202f96 Merge pull request #174 from per1234/fix-nano-33-ble-conditional
Make preprocessor conditional false when identifier undefined
2020-12-01 21:21:34 -05:00
86115884c7 Make preprocessor conditional false when identifier undefined
A preprocessor conditional directive intended to only evaluate as true when compiling for the Arduino Nano 33 BLE board
was also evaluating as true when compiling for any board that didn't define the compared identifiers because undefined
identifiers are replaced with 0 by the C/C++ preprocessor, making them equal.

From the C++11 standard section 16.1, paragraph 4:

> After all replacements due to macro expansion and the defined unary operator
have been performed, all remaining identifiers and keywords 148 , except for true and false, are replaced
with the pp-number 0

The fix is to modify the directive to check whether the macro has been defined.
2020-12-01 17:53:54 -08:00
2 changed files with 2 additions and 2 deletions

2
DHT.h
View File

@ -47,7 +47,7 @@
#define DHT21 21 /**< DHT TYPE 21 */
#define AM2301 21 /**< AM2301 */
#if (TARGET_NAME == ARDUINO_NANO33BLE)
#if defined(TARGET_NAME) && (TARGET_NAME == ARDUINO_NANO33BLE)
#ifndef microsecondsToClockCycles
/*!
* As of 7 Sep 2020 the Arduino Nano 33 BLE boards do not have

View File

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