summaryrefslogtreecommitdiffstats
path: root/firmware/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/kernel.c')
-rw-r--r--firmware/kernel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c
index afdb0bd1d3..06b2fc1039 100644
--- a/firmware/kernel.c
+++ b/firmware/kernel.c
@@ -37,12 +37,12 @@ void kernel_init(void)
void sleep(int ticks)
{
- int timeout = current_tick + ticks;
+ /* Always sleep at least 1 tick */
+ int timeout = current_tick + ticks + 1;
- /* always yield at least once */
- do {
+ while (TIME_BEFORE( current_tick, timeout )) {
yield();
- } while (TIME_BEFORE( current_tick, timeout ));
+ }
}
void yield(void)