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

drivers/tmp00x : Add CONFIG_

Add CONFIG_ prefix to compile configurations
This commit is contained in:
Akshai M 2020-04-29 22:11:13 +05:30
parent 99e7b81d10
commit 94d6b898fc
4 changed files with 13 additions and 13 deletions

View File

@ -103,15 +103,15 @@ 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
/**
@ -119,11 +119,11 @@ extern "C"
*
* 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
/**
@ -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
/** @} */

View File

@ -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

View File

@ -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;

View File

@ -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) {
@ -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;