diff options
author | Uros Majstorovic <majstor@majstor.org> | 2021-04-08 21:30:12 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2021-04-08 21:30:12 +0200 |
commit | fc7c7130fee73c5aad2d7a774d5a7712eb3e8e6a (patch) | |
tree | f4ecb67c0594abfcca6d62cbc8c35895babf0d8d /fw/fe310/eos/timer.c | |
parent | 5c4ad4969514b82285ef37922f7acf61600c70de (diff) |
sdcard driver
Diffstat (limited to 'fw/fe310/eos/timer.c')
-rw-r--r-- | fw/fe310/eos/timer.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; + } |