zephyr/main: allow to build when CONFIG_MULTITHREADING=n
K_sleep() is not available when multithreading is disabled.
Let's use k_busy_wait() in that case.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
diff --git a/boot/zephyr/main.c b/boot/zephyr/main.c
index b375656..a4f87e9 100644
--- a/boot/zephyr/main.c
+++ b/boot/zephyr/main.c
@@ -390,7 +390,11 @@
if (detect_value == expected) {
if (delay > 0) {
+#ifdef CONFIG_MULTITHREADING
k_sleep(K_MSEC(50));
+#else
+ k_busy_wait(50000);
+#endif
/* Get the uptime for debounce purposes. */
int64_t timestamp = k_uptime_get();
@@ -409,7 +413,11 @@
}
/* Delay 1 ms */
+#ifdef CONFIG_MULTITHREADING
k_sleep(K_MSEC(1));
+#else
+ k_busy_wait(1000);
+#endif
}
}
}