summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/soc/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/soc/timer.c')
-rw-r--r--fw/fe310/eos/soc/timer.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fw/fe310/eos/soc/timer.c b/fw/fe310/eos/soc/timer.c
index 8d74c6d..0573e84 100644
--- a/fw/fe310/eos/soc/timer.c
+++ b/fw/fe310/eos/soc/timer.c
@@ -48,7 +48,7 @@ void _eos_timer_handle(void) {
if (*mtimecmp == 0) clear_csr(mie, MIP_MTIP);
}
-int eos_timer_init(uint8_t wakeup_cause) {
+int eos_timer_init(void) {
uint64_t *mtimecmp = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIMECMP);
int i;
@@ -75,18 +75,18 @@ uint32_t eos_timer_get(unsigned char evt) {
volatile uint64_t *mtime = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIME);
uint64_t *mtimecmp = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIMECMP);
uint64_t now;
- uint32_t ret;
+ uint32_t rv;
if (*mtimecmp != 0) clear_csr(mie, MIP_MTIP);
now = *mtime;
if (timer_next[evt]) {
- ret = (timer_next[evt] > now) ? (timer_next[evt] - now) * 1000 / EOS_TIMER_RTC_FREQ : 0;
+ rv = (timer_next[evt] > now) ? (timer_next[evt] - now) * 1000 / EOS_TIMER_RTC_FREQ : 0;
} else {
- ret = EOS_TIMER_NONE;
+ rv = EOS_TIMER_NONE;
}
if (*mtimecmp != 0) set_csr(mie, MIP_MTIP);
- return ret;
+ return rv;
}
void eos_timer_set(unsigned char evt, uint32_t msec) {
@@ -121,24 +121,24 @@ void eos_timer_clear(unsigned char evt) {
if (*mtimecmp != 0) set_csr(mie, MIP_MTIP);
}
-void eos_time_sleep(uint32_t msec) {
+void eos_sleep(uint32_t msec) {
volatile uint64_t *mtime = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIME);
uint32_t mtime0 = *mtime;
while ((*mtime - mtime0) < (msec * EOS_TIMER_RTC_FREQ / 1000 + 1));
}
-uint32_t eos_time_get_tick(void) {
+uint32_t eos_get_tick(void) {
volatile uint64_t *mtime = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIME);
return *mtime;
}
-uint64_t eos_time_get_tick64(void) {
+uint64_t eos_get_tick64(void) {
volatile uint64_t *mtime = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIME);
return *mtime;
}
-uint32_t eos_time_delta_ms(uint32_t tick) {
- return (eos_time_get_tick() - tick) * 1000 / EOS_TIMER_RTC_FREQ;
+uint32_t eos_tdelta_ms(uint32_t tick) {
+ return (eos_get_tick() - tick) * 1000 / EOS_TIMER_RTC_FREQ;
}