From b229f77ac1e7a19aeb6937c98c8f7fe01238823b Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Mon, 24 Jan 2022 18:20:09 +0100 Subject: [PATCH] drivers/lis2dh12: use ifdef instead of IS_USED Using IS_USED leads to undefined API references --- drivers/lis2dh12/lis2dh12.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/lis2dh12/lis2dh12.c b/drivers/lis2dh12/lis2dh12.c index 56d6cd493c..7e46e3f8bd 100644 --- a/drivers/lis2dh12/lis2dh12.c +++ b/drivers/lis2dh12/lis2dh12.c @@ -593,11 +593,11 @@ int lis2dh12_read_temperature(const lis2dh12_t *dev, int16_t *temp) /* enable temperature sensor */ if (!_read(dev, REG_TEMP_CFG_REG)) { - uint8_t odr = _read(dev, REG_CTRL_REG1) >> 4; _write(dev, REG_TEMP_CFG_REG, LIS2DH12_TEMP_CFG_REG_ENABLE); - if (IS_USED(MODULE_ZTIMER)) { - ztimer_sleep(ZTIMER_MSEC, MS_PER_SEC / hz_per_dr[odr]); - } +#if IS_USED(MODULE_ZTIMER_MSEC) + uint8_t odr = _read(dev, REG_CTRL_REG1) >> 4; + ztimer_sleep(ZTIMER_MSEC, MS_PER_SEC / hz_per_dr[odr]); +#endif } _read_burst(dev, REG_OUT_TEMP_L, bytes, sizeof(bytes));