[riot-commits] [RIOT-OS/RIOT] c75bac: drivers/dht: Added error handling

MichelRottleuthner noreply at github.com
Mon Jul 29 11:12:23 CEST 2019


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: c75baccebad869041cd4e05d5199ef7c18672c54
      https://github.com/RIOT-OS/RIOT/commit/c75baccebad869041cd4e05d5199ef7c18672c54
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2019-07-19 (Fri, 19 Jul 2019)

  Changed paths:
    M drivers/dht/dht.c
    M drivers/dht/dht_saul.c
    M drivers/include/dht.h

  Log Message:
  -----------
  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.


  Commit: d2d83c3bd0767131f097d91e5d5b2d11d4d268b4
      https://github.com/RIOT-OS/RIOT/commit/d2d83c3bd0767131f097d91e5d5b2d11d4d268b4
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2019-07-19 (Fri, 19 Jul 2019)

  Changed paths:
    M drivers/dht/dht.c

  Log Message:
  -----------
  drivers/dht: Fixed assert on uninitialized data

Instead of asserting that parameters are valid, dht_init() contained an assert
on uninitialized data. This commit fixes that assert


  Commit: 579a67be032bd04be647c44adfce8a7a1de5321b
      https://github.com/RIOT-OS/RIOT/commit/579a67be032bd04be647c44adfce8a7a1de5321b
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2019-07-29 (Mon, 29 Jul 2019)

  Changed paths:
    M drivers/dht/dht.c
    M drivers/dht/dht_saul.c
    M drivers/include/dht.h

  Log Message:
  -----------
  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.


  Commit: 8cbf63678183b078dae571a13871629495bbed1c
      https://github.com/RIOT-OS/RIOT/commit/8cbf63678183b078dae571a13871629495bbed1c
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2019-07-29 (Mon, 29 Jul 2019)

  Changed paths:
    M drivers/dht/dht.c

  Log Message:
  -----------
  drivers/dht: Fixed magic numbers & missing doc

- Replaced magic number by preprocessor macros and documented them
- Added comment to explain why DHT21 is not part of the switch() expression


  Commit: a90cc36eb4c91a16042df448f3bef6ff4bacc652
      https://github.com/RIOT-OS/RIOT/commit/a90cc36eb4c91a16042df448f3bef6ff4bacc652
  Author: MichelRottleuthner <michel.rottleuthner at haw-hamburg.de>
  Date:   2019-07-29 (Mon, 29 Jul 2019)

  Changed paths:
    M drivers/dht/dht.c
    M drivers/dht/dht_saul.c
    M drivers/include/dht.h

  Log Message:
  -----------
  Merge pull request #11876 from maribu/dht

drivers/dht: Bugfixes for functionality, error handling, and documentation


Compare: https://github.com/RIOT-OS/RIOT/compare/a9ab9d37e2fe...a90cc36eb4c9


More information about the commits mailing list