From 8755ad4c0b0652f16d3505ed72ed3d8310a35c6f Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 15 Mar 2018 21:37:11 +0100 Subject: removed *IFace from context --- code/ecp/fe310/time.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'code/ecp/fe310/time.c') diff --git a/code/ecp/fe310/time.c b/code/ecp/fe310/time.c index 4b8b2a7..fedd23a 100644 --- a/code/ecp/fe310/time.c +++ b/code/ecp/fe310/time.c @@ -1,25 +1,21 @@ #include +#include #include #include "encoding.h" #include "platform.h" -static ecp_cts_t t_abstime_ms(ecp_cts_t msec) { +ecp_cts_t ecp_tm_abstime_ms(ecp_cts_t msec) { volatile uint64_t *mtime = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIME); uint64_t now_ms = *mtime * 1000 / RTC_FREQ; return now_ms + msec; } -static void t_timer_set(ecp_cts_t next) { +void ecp_tm_sleep_ms(ecp_cts_t msec) {} + +void ecp_tm_timer_set(ecp_cts_t next) { uint32_t tick = next * (uint64_t)RTC_FREQ / 1000; eos_timer_set(tick, 1); } - -int ecp_time_init(ECPTimeIface *t) { - t->init = 1; - t->abstime_ms = t_abstime_ms; - t->timer_set = t_timer_set; - return 0; -} -- cgit v1.2.3