From 01c3e3af2394f863323b846fa304ff7e0a30e9df Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Tue, 16 Jan 2018 23:43:07 +0100 Subject: eos support --- code/ecp/fe310/time.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'code/ecp/fe310/time.c') diff --git a/code/ecp/fe310/time.c b/code/ecp/fe310/time.c index 2ff98cb..4b8b2a7 100644 --- a/code/ecp/fe310/time.c +++ b/code/ecp/fe310/time.c @@ -1,5 +1,7 @@ #include +#include + #include "encoding.h" #include "platform.h" @@ -10,9 +12,14 @@ static ecp_cts_t t_abstime_ms(ecp_cts_t msec) { return now_ms + msec; } +static void t_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->sleep_ms = NULL; + t->timer_set = t_timer_set; return 0; } -- cgit v1.2.3