summaryrefslogtreecommitdiff
path: root/code/ecp/fe310/time.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2018-03-15 21:37:11 +0100
committerUros Majstorovic <majstor@majstor.org>2018-03-15 21:37:11 +0100
commit8755ad4c0b0652f16d3505ed72ed3d8310a35c6f (patch)
tree6d7c3b93563bf64b811bb198e13ebbe7d7907e67 /code/ecp/fe310/time.c
parentb00f381106c941ea03e5ea04dc08e6c4b9e582fa (diff)
removed *IFace from context
Diffstat (limited to 'code/ecp/fe310/time.c')
-rw-r--r--code/ecp/fe310/time.c14
1 files changed, 5 insertions, 9 deletions
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 <core.h>
+#include <tr.h>
#include <eos/timer.h>
#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;
-}