Skip to content

Commit

Permalink
Adding access headers to DHT
Browse files Browse the repository at this point in the history
  • Loading branch information
wavesoft committed Jan 15, 2019
1 parent b7cb715 commit 84a8902
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .library.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
"type": "git",
"url": "https://github.com/tlabio/arduino-unode.git"
},
"version": "0.8.0"
"version": "0.8.1"
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ This repository is currently being renovated. More information will be available
* **ADDED** : Under-voltage protection limits can be now configured in the `.undervoltageProtection` structure.
* **ADDED** : `.tx_sf`, `.tx_power` and `.adr` on LoRa configuration segment.

#### 0.8.0

* **ADDED** : Added the `uNode/libraries/DHT.hpp` library.

## Closed-Source Features

The following features are closed-source and they are only available on the binary release of the library:
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=uNode-Open
version=0.8.0
version=0.8.1
author=Ioannis Charalampidis <[email protected]>
maintainer=Ioannis Charalampidis <[email protected]>
sentence=Hardware abstraction library for TLab uNode<br />
Expand Down
30 changes: 30 additions & 0 deletions src/uNode/libraries/DHT.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*******************************************************************************
* Copyright (c) 2019 Ioannis Charalampidis, Gijs Mos
*
* This is a private, preview release of the uNode hardware abstraction library.
* The holder of a copy of this software and associated documentation files
* (the "Software") is allowed to use the Software without any obligation to
* create private and/or commercial projects. The Software can be obtained
* through the official channels of the author, including but not limited to
* Github and the official TLab.gr website. It is FORBIDDEN however to modify,
* reverse-engineer, publish, distribute, sublicense, and/or sell copies of the
* Software itself.
*
* The license for this file might change in a future release. The author is not
* obliged to announce this change through any channel but it should be included
* in the release notes.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*******************************************************************************/

/**
* This file is solely a placeholder to provide a more logical access to the
* uNode-Adapted version of the DHT sensor.
*/
#include "../../vendor/DHT_sensor_library/uNodeDHT.hpp"
2 changes: 1 addition & 1 deletion src/vendor/DHT_sensor_library/uNodeDHT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ boolean DHT::read(bool force) {
for (int i = 0; i < 40; ++i) {
uint32_t lowCycles = cycles[2 * i];
uint32_t highCycles = cycles[2 * i + 1];
if ((lowCycles == -1) || (highCycles == -1)) {
if ((lowCycles == 0xFFFFFFFF) || (highCycles == 0xFFFFFFFF)) {
DEBUG_PRINTLN(F("Timeout waiting for pulse."));
_lastresult = false;
return _lastresult;
Expand Down

0 comments on commit 84a8902

Please sign in to comment.