From fc7c7130fee73c5aad2d7a774d5a7712eb3e8e6a Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 8 Apr 2021 21:30:12 +0200 Subject: sdcard driver --- fw/fe310/eos/timer.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fw/fe310/eos/timer.c') diff --git a/fw/fe310/eos/timer.c b/fw/fe310/eos/timer.c index e07b9a6..d8cf107 100644 --- a/fw/fe310/eos/timer.c +++ b/fw/fe310/eos/timer.c @@ -129,3 +129,7 @@ uint64_t eos_time_get_tick(void) { volatile uint64_t *mtime = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIME); return *mtime; } + +uint32_t eos_time_since(uint32_t start) { + return (eos_time_get_tick() - start) * 1000 / EOS_TIMER_RTC_FREQ; + } -- cgit v1.2.3