From 9d70fbf2e1933fd8f02a13ce3d0cd7dc791d1401 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 15 Jan 2024 14:30:56 +0100 Subject: [PATCH] cpu/sam0_common: SDHC: make use of busy_wait() --- cpu/sam0_common/sam0_sdhc/sdhc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/sam0_common/sam0_sdhc/sdhc.c b/cpu/sam0_common/sam0_sdhc/sdhc.c index d851e8a87b..b38eb93c0d 100644 --- a/cpu/sam0_common/sam0_sdhc/sdhc.c +++ b/cpu/sam0_common/sam0_sdhc/sdhc.c @@ -48,6 +48,7 @@ #include #include #include +#include "busy_wait.h" #include "periph_cpu.h" #include "periph/pm.h" #include "macros/math.h" @@ -127,8 +128,7 @@ static void _delay(unsigned us) } else if (IS_USED(MODULE_ZTIMER_MSEC)) { ztimer_sleep(ZTIMER_MSEC, 1); } else { - volatile unsigned count = (us * CLOCK_CORECLOCK) / US_PER_SEC; - while (--count) {} + busy_wait_us(us); } }