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

Merge pull request #17563 from fjmolinas/pr_lis2dh12_fix_ifdef

drivers/lis2dh12: use ifdef instead of IS_USED
This commit is contained in:
Alexandre Abadie 2022-01-25 11:14:17 +01:00 committed by GitHub
commit 6ba8962a45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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