summaryrefslogtreecommitdiff
path: root/chip/g/hwtimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/g/hwtimer.c')
-rw-r--r--chip/g/hwtimer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/chip/g/hwtimer.c b/chip/g/hwtimer.c
index 9fbe3f0920..7d9b31e470 100644
--- a/chip/g/hwtimer.c
+++ b/chip/g/hwtimer.c
@@ -211,3 +211,12 @@ void udelay(unsigned us)
;
}
#endif /* CONFIG_HW_SPECIFIC_UDELAY */
+
+void tick_delay(uint32_t ticks)
+{
+ uint32_t cur_tick = GREG32(TIMELS, SOURCE(VALUE));
+
+ /* Note: the counter counts down. */
+ while ((cur_tick - GREG32(TIMELS, SOURCE(VALUE))) < ticks)
+ ;
+}