diff options
Diffstat (limited to 'src/util/time.c')
-rw-r--r-- | src/util/time.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util/time.c b/src/util/time.c index 0ae3ccf..abb9c8d 100644 --- a/src/util/time.c +++ b/src/util/time.c @@ -67,3 +67,10 @@ unsigned long long get_time(void) t.tvalb.high = *(unsigned long*)SYS_TIMER_CHI; return t.tval; } + +void wait_msec(unsigned int n) +{ + unsigned long start = *(volatile unsigned long*)SYS_TIMER_CHI; + while (*(volatile unsigned long*)SYS_TIMER_CHI - start < n) + asm volatile("nop"); +} |