Skip to content

Commit 84a8902

Browse files
committed
Adding access headers to DHT
1 parent b7cb715 commit 84a8902

File tree

5 files changed

+37
-3
lines changed

5 files changed

+37
-3
lines changed

.library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@
3434
"type": "git",
3535
"url": "https://github.com/tlabio/arduino-unode.git"
3636
},
37-
"version": "0.8.0"
37+
"version": "0.8.1"
3838
}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ This repository is currently being renovated. More information will be available
2323
* **ADDED** : Under-voltage protection limits can be now configured in the `.undervoltageProtection` structure.
2424
* **ADDED** : `.tx_sf`, `.tx_power` and `.adr` on LoRa configuration segment.
2525

26+
#### 0.8.0
27+
28+
* **ADDED** : Added the `uNode/libraries/DHT.hpp` library.
29+
2630
## Closed-Source Features
2731

2832
The following features are closed-source and they are only available on the binary release of the library:

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=uNode-Open
2-
version=0.8.0
2+
version=0.8.1
33
author=Ioannis Charalampidis <[email protected]>
44
maintainer=Ioannis Charalampidis <[email protected]>
55
sentence=Hardware abstraction library for TLab uNode<br />

src/uNode/libraries/DHT.hpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2019 Ioannis Charalampidis, Gijs Mos
3+
*
4+
* This is a private, preview release of the uNode hardware abstraction library.
5+
* The holder of a copy of this software and associated documentation files
6+
* (the "Software") is allowed to use the Software without any obligation to
7+
* create private and/or commercial projects. The Software can be obtained
8+
* through the official channels of the author, including but not limited to
9+
* Github and the official TLab.gr website. It is FORBIDDEN however to modify,
10+
* reverse-engineer, publish, distribute, sublicense, and/or sell copies of the
11+
* Software itself.
12+
*
13+
* The license for this file might change in a future release. The author is not
14+
* obliged to announce this change through any channel but it should be included
15+
* in the release notes.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23+
*
24+
*******************************************************************************/
25+
26+
/**
27+
* This file is solely a placeholder to provide a more logical access to the
28+
* uNode-Adapted version of the DHT sensor.
29+
*/
30+
#include "../../vendor/DHT_sensor_library/uNodeDHT.hpp"

src/vendor/DHT_sensor_library/uNodeDHT.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ boolean DHT::read(bool force) {
186186
for (int i = 0; i < 40; ++i) {
187187
uint32_t lowCycles = cycles[2 * i];
188188
uint32_t highCycles = cycles[2 * i + 1];
189-
if ((lowCycles == -1) || (highCycles == -1)) {
189+
if ((lowCycles == 0xFFFFFFFF) || (highCycles == 0xFFFFFFFF)) {
190190
DEBUG_PRINTLN(F("Timeout waiting for pulse."));
191191
_lastresult = false;
192192
return _lastresult;

0 commit comments

Comments
 (0)