From 695d29ba60a5c4946bb16d2378955fa8bad8bead Mon Sep 17 00:00:00 2001 From: Matthias Fend Date: Tue, 1 Feb 2022 14:52:21 +0100 Subject: [PATCH] lib: system: zephyr: implement __metal_sleep_usec The currently missing implementation causes invalid timeouts when sending remoteproc messages over virtIO. With this change, the specified timeout of 15 seconds can be achieved. This seems to be the only usage in Zephyr. Signed-off-by: Matthias Fend --- lib/system/zephyr/sleep.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/system/zephyr/sleep.h b/lib/system/zephyr/sleep.h index a55b1cc..4333990 100644 --- a/lib/system/zephyr/sleep.h +++ b/lib/system/zephyr/sleep.h @@ -16,7 +16,7 @@ #ifndef __METAL_ZEPHYR_SLEEP__H__ #define __METAL_ZEPHYR_SLEEP__H__ -#include +#include #ifdef __cplusplus extern "C" { @@ -24,8 +24,7 @@ extern "C" { static inline int __metal_sleep_usec(unsigned int usec) { - metal_unused(usec); - /* Fix me */ + k_sleep(K_USEC(usec)); return 0; }