Skip to content

Commit

Permalink
drivers/dht: adapted to GPIO changes
Browse files Browse the repository at this point in the history
  • Loading branch information
haukepetersen committed Mar 17, 2016
1 parent dd16560 commit 08ce2a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions drivers/dht/dht.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ int dht_read(dht_t *dev, int16_t *temp, int16_t *hum)
xtimer_usleep(40);

/* sync on device */
gpio_init(dev, dev->in_mode);
while (!gpio_read(dev)) ;
while (gpio_read(dev)) ;
gpio_init(dev->pin, dev->in_mode);
while (!gpio_read(dev->pin)) ;
while (gpio_read(dev->pin)) ;

/*
* data is read in sequentially, highest bit first:
Expand Down
8 changes: 4 additions & 4 deletions drivers/dht/include/dht_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ extern "C" {
#define DHT_PARAM_TYPE (DHT11)
#endif
#ifndef DHT_PARAM_PULL
#define DHT_PARAM_PULL (GPIO_PULLUP)
#define DHT_PARAM_PULL (GPIO_IN_PU)
#endif

#define DHT_PARAMS_DEFAULT {.pin = DHT_PARAM_PIN, \
.type = DHT_PARAM_TYPE, \
.pull = DHT_PARAM_PULL}
#define DHT_PARAMS_DEFAULT {.pin = DHT_PARAM_PIN, \
.type = DHT_PARAM_TYPE, \
.in_mode = DHT_PARAM_PULL}
/**@}*/

/**
Expand Down
4 changes: 2 additions & 2 deletions drivers/include/dht.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ typedef enum {
typedef struct {
gpio_t pin; /**< GPIO pin of the device's data pin */
dht_type_t type; /**< type of the DHT device */
gpio_mode_t in_mode; /**< internal pull resistor configuration, set to
* GPIO_NOPULL when using an external pull-up */
gpio_mode_t in_mode; /**< input pin configuration, with or without pull
* resistor */
} dht_t;

/**
Expand Down

0 comments on commit 08ce2a5

Please sign in to comment.