summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/host/timer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/host/timer.c b/core/host/timer.c
index dd8b88dbb4..ff17ddf068 100644
--- a/core/host/timer.c
+++ b/core/host/timer.c
@@ -28,8 +28,14 @@ static int time_set;
void usleep(unsigned us)
{
+ if (!task_start_called()) {
+ udelay(us);
+ return;
+ }
+
ASSERT(!in_interrupt_context() &&
task_get_current() != TASK_ID_INT_GEN);
+
task_wait_event(us);
}