Skip to content

Commit

Permalink
drivers/hdc1000 : Add CONFIG_
Browse files Browse the repository at this point in the history
Add CONFIG_ Prefix for configuring the Compile time macros
  • Loading branch information
akshaim committed Apr 16, 2020
1 parent 5de5cea commit 7a4191a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion drivers/hdc1000/hdc1000.c
Expand Up @@ -130,7 +130,7 @@ int hdc1000_read(const hdc1000_t *dev, int16_t *temp, int16_t *hum)
if (hdc1000_trigger_conversion(dev) != HDC1000_OK) {
return HDC1000_BUSERR;
}
xtimer_usleep(HDC1000_CONVERSION_TIME);
xtimer_usleep(CONFIG_HDC1000_CONVERSION_TIME);
return hdc1000_get_results(dev, temp, hum);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/hdc1000/include/hdc1000_params.h
Expand Up @@ -35,7 +35,7 @@ extern "C" {
#define HDC1000_PARAM_I2C I2C_DEV(0)
#endif
#ifndef HDC1000_PARAM_ADDR
#define HDC1000_PARAM_ADDR (HDC1000_I2C_ADDRESS)
#define HDC1000_PARAM_ADDR (CONFIG_HDC1000_I2C_ADDRESS)
#endif
#ifndef HDC1000_PARAM_RES
#define HDC1000_PARAM_RES HDC1000_14BIT
Expand Down
12 changes: 6 additions & 6 deletions drivers/include/hdc1000.h
Expand Up @@ -21,7 +21,7 @@
* simplified `hdc1000_read()` function, or the conversion can be triggered
* manually using the `hdc1000_trigger_conversion()` and `hdc1000_get_results()`
* functions sequentially. If using the second method, on must wait at least
* `HDC1000_CONVERSION_TIME` between triggering the conversion and reading the
* `CONFIG_HDC1000_CONVERSION_TIME` between triggering the conversion and reading the
* results.
*
* @note The driver does currently not support using the devices heating
Expand Down Expand Up @@ -62,8 +62,8 @@ extern "C"
* The address value depends on the state of ADR0 and ADR1 Pins
* For more details refer Section 8.5.1 of datasheet
*/
#ifndef HDC1000_I2C_ADDRESS
#define HDC1000_I2C_ADDRESS (0x43)
#ifndef CONFIG_HDC1000_I2C_ADDRESS
#define CONFIG_HDC1000_I2C_ADDRESS (0x43)
#endif

/**
Expand All @@ -73,8 +73,8 @@ extern "C"
* conversions (worst case) to allow for timer imprecision:
* (convert temp + convert hum) * 2 -> (6.5ms + 6.5ms) * 2 := 26ms.
*/
#ifndef HDC1000_CONVERSION_TIME
#define HDC1000_CONVERSION_TIME (26000)
#ifndef CONFIG_HDC1000_CONVERSION_TIME
#define CONFIG_HDC1000_CONVERSION_TIME (26000)
#endif
/** @} */

Expand Down Expand Up @@ -129,7 +129,7 @@ int hdc1000_init(hdc1000_t *dev, const hdc1000_params_t *params);
* @brief Trigger a new conversion
*
* After the conversion is triggered, one has to wait
* @ref HDC1000_CONVERSION_TIME us until the results can be read using
* @ref CONFIG_HDC1000_CONVERSION_TIME us until the results can be read using
* @ref hdc1000_get_results().
*
* @param[in] dev device descriptor of sensor
Expand Down

0 comments on commit 7a4191a

Please sign in to comment.