From 1c7afa923b416f51d1c43417e32fd958da2f0c67 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 7 Feb 2024 13:34:54 +1100 Subject: [PATCH] drivers/dht: Only build DHT driver if MICROPY_PY_MACHINE_PULSE enabled. Because this driver calls `machine_time_pulse_us()`. Signed-off-by: Damien George --- drivers/dht/dht.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/dht/dht.c b/drivers/dht/dht.c index 73afdee58..7e9b89782 100644 --- a/drivers/dht/dht.c +++ b/drivers/dht/dht.c @@ -29,6 +29,9 @@ #include "py/runtime.h" #include "py/mperrno.h" #include "py/mphal.h" + +#if MICROPY_PY_MACHINE_PULSE + #include "extmod/modmachine.h" #include "drivers/dht/dht.h" @@ -92,3 +95,5 @@ timeout: mp_raise_OSError(MP_ETIMEDOUT); } MP_DEFINE_CONST_FUN_OBJ_2(dht_readinto_obj, dht_readinto); + +#endif // MICROPY_PY_MACHINE_PULSE