summaryrefslogtreecommitdiff
path: root/core/cortex-m/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/cortex-m/timer.c')
-rw-r--r--core/cortex-m/timer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/cortex-m/timer.c b/core/cortex-m/timer.c
index 994f9c1245..10370aeeb6 100644
--- a/core/cortex-m/timer.c
+++ b/core/cortex-m/timer.c
@@ -169,6 +169,14 @@ timestamp_t get_time(void)
}
+void force_time(timestamp_t ts)
+{
+ clksrc_high = ts.le.hi;
+ __hw_clock_source_set(ts.le.lo);
+ /* some timers might be already expired : process them */
+ task_trigger_irq(timer_irq);
+}
+
void timer_print_info(void)
{
uint64_t t = get_time().val;