forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: improve the arcv2_timer driver to update cycles correctly
referring the ARM's Systick driver, we did the following improvements: * use 31 bits of 32-bit counter to avoid the rare but possible overflow of elapsed(). If 32 bits val are used, elpased() may return a wrong value. then wrong HW cycles. * two ways to update the correct cycles - through systick timer irq - when systick timer irq cann't be handled because of irq locked/disabled, call z_timer_cycle_get_32->elapsed to update the correct cylces. no more than one counter-wrap is allowed. * if elapsed() is not called too long (more than one counter-wrap) from systick tiemr irq or from z_timer_cycle_get_32. The lost of HW cycles is unavoidable. * some detailed discussion can be found in zephyrproject-rtos#24332 Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
- Loading branch information
Wayne Ren
committed
Apr 21, 2020
1 parent
7c5c4da
commit 17c355f
Showing
1 changed file
with
119 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters