1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

7 Commits

Author SHA1 Message Date
Marian Buschsieweke
16f859dafd
drivers/saul: use const qualifier for data to write
This makes life easier when calling e.g. `saul_reg_write()` with data
stored in flash.

As now the signatures for reading and writing differ (in that `const`
qualifier only), `saul_notsup()` is split into `saul_write_notsup()`
and `saul_read_notsup()`. However, one is implemented as a symbol alias
of the other, so that ROM consumption remains unchanged.
2022-05-23 08:35:27 +02:00
Marian Buschsieweke
579a67be03
drivers/dht: Move hold logic from SAUL to driver
The DHT11/DHT21/DHT22 cannot be sampled more than once a second. Previously,
a global cache was added to the SAUL adaption of the dht driver to answer with
stored values for one second after the last read. This however had two
disadvantages:

- The global cache was shared for all DHTXX devices connected. As a result
  incorrect values were delivered when reading out multiple sensors over SAUL
  with less than 1 second delay in between
- A user of the low level API will had to implement the same caching strategy,
  resulting in code duplication

By moving the hold logic to the driver, both limitations can be overcome.
2019-07-29 10:39:50 +02:00
Marian Buschsieweke
c75bacceba
drivers/dht: Added error handling
Previously the DHT11/DHT21/DHT22 driver ended up in an infinite loop locking up
RIOT when a communication error occurred. This commit adds a simple timeout to
the communication in order to prevent these lock ups.
2019-07-19 15:57:49 +02:00
Kees Bakker
0cb92e1e51 drivers: replace memset by simple assignments
A memset was used to clear two of the SAUL values in phydat_t::val
The change is to replace that by the following
    res->val[1] = 0;
    res->val[2] = 0;
which makes the code more obvious.
2019-01-07 21:59:25 +01:00
smlng
946256d26f saul: use const for device parameter 2017-06-26 20:25:37 +02:00
Joakim Nohlgård
7c48c891a0 xtimer: Update xtimer usage to match API changes 2016-11-29 20:44:31 +01:00
Hauke Petersen
7c86467ef0 drivers/dht: added SAUL support 2016-03-17 10:39:42 +01:00