1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 07:21:18 +01:00

Merge pull request #11046 from kaspar030/reset_fe310_timer

cpu/fe310: periph/timer: reset counter in timer_init()
This commit is contained in:
Kaspar Schleiser 2019-04-09 15:50:19 +02:00 committed by GitHub
commit 38cc72d0e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,11 @@ int timer_init(tim_t dev, unsigned long freq, timer_cb_t cb, void *arg)
isr_cb = cb;
isr_arg = arg;
/* No other configuration */
/* reset timer counter */
volatile uint64_t *mtime = (uint64_t *) (CLINT_CTRL_ADDR + CLINT_MTIME);
*mtime = 0;
return 0;
}