Skip to content

Commit

Permalink
drivers/tmp00x : Add CONFIG_
Browse files Browse the repository at this point in the history
Add CONFIG_ prefix to compile configurations
  • Loading branch information
akshaim committed Apr 30, 2020
1 parent 6a75e04 commit a6aa921
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions drivers/include/tmp00x.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,27 +103,27 @@ extern "C"
* I2C Address depends on the state of ADR0 and ADR1 Pins
* For more information, please refer to section 7.3.6.2 of TMP007 datasheet (SBOS685B).
*/
#ifndef TMP00X_I2C_ADDRESS
#define TMP00X_I2C_ADDRESS (0x40)
#ifndef CONFIG_TMP00X_I2C_ADDRESS
#define CONFIG_TMP00X_I2C_ADDRESS (0x40)
#endif

/**
* @brief Default Conversion Time in us
*/
#ifndef TMP00X_CONVERSION_TIME
#define TMP00X_CONVERSION_TIME (1E6)
#ifndef CONFIG_TMP00X_CONVERSION_TIME
#define CONFIG_TMP00X_CONVERSION_TIME (1E6)
#endif

/**
* @brief Default low power mode
*
* If set to 0, the device will be always-on
* If set to 1, the device will be put in low power mode between measurements.
* This adds a @c TMP00X_CONVERSION_TIME us delay to each measurement call
* This adds a @c CONFIG_TMP00X_CONVERSION_TIME us delay to each measurement call
* for bringing the device out of standby.
*/
#ifndef TMP00X_USE_LOW_POWER
#define TMP00X_USE_LOW_POWER (0)
#ifndef CONFIG_TMP00X_USE_LOW_POWER
#define CONFIG_TMP00X_USE_LOW_POWER (0)
#endif

/**
Expand All @@ -132,8 +132,8 @@ extern "C"
* If set to 0, measurements will be converted to Celsius.
* If set to 1, raw adc readings will be returned.
*/
#ifndef TMP00X_USE_RAW_VALUES
#define TMP00X_USE_RAW_VALUES (0)
#ifndef CONFIG_TMP00X_USE_RAW_VALUES
#define CONFIG_TMP00X_USE_RAW_VALUES (0)
#endif
/** @} */

Expand Down
2 changes: 1 addition & 1 deletion drivers/tmp00x/include/tmp00x_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern "C" {
#define TMP00X_PARAM_I2C I2C_DEV(0)
#endif
#ifndef TMP00X_PARAM_ADDR
#define TMP00X_PARAM_ADDR (TMP00X_I2C_ADDRESS)
#define TMP00X_PARAM_ADDR (CONFIG_TMP00X_I2C_ADDRESS)
#endif
#ifndef TMP00X_PARAM_RATE
#define TMP00X_PARAM_RATE TMP00X_CONFIG_CR_DEF
Expand Down
2 changes: 1 addition & 1 deletion drivers/tmp00x/tmp00x.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ int tmp00x_read_temperature(const tmp00x_t *dev, int16_t *ta, int16_t *to)
if (tmp00x_set_active(dev)) {
return TMP00X_ERROR;
}
xtimer_usleep(TMP00X_CONVERSION_TIME);
xtimer_usleep(CONFIG_TMP00X_CONVERSION_TIME);
#endif

int ret;
Expand Down
4 changes: 2 additions & 2 deletions tests/driver_tmp00x/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main(void)
puts("start measurement [ERROR]");
return -1;
}
xtimer_usleep(TMP00X_CONVERSION_TIME);
xtimer_usleep(CONFIG_TMP00X_CONVERSION_TIME);
puts("[SUCCESS]\n");

while (1) {
Expand All @@ -60,7 +60,7 @@ int main(void)
else {
puts("conversion in progress ... ");
}
xtimer_usleep(TMP00X_CONVERSION_TIME);
xtimer_usleep(CONFIG_TMP00X_CONVERSION_TIME);
}

return 0;
Expand Down

0 comments on commit a6aa921

Please sign in to comment.