forked from Imagelibrary/rtems
bsps/arm: Fix ARMv7-M CPU counter
Read the current counter value again after we know that we had an underflow. Update #3456.
This commit is contained in:
@@ -59,6 +59,7 @@ static uint32_t _ARMV7M_Clock_counter(ARMV7M_Timecounter *tc)
|
|||||||
ticks = tc->ticks;
|
ticks = tc->ticks;
|
||||||
|
|
||||||
if ((systick->csr & ARMV7M_SYSTICK_CSR_COUNTFLAG) != 0) {
|
if ((systick->csr & ARMV7M_SYSTICK_CSR_COUNTFLAG) != 0) {
|
||||||
|
counter = systick->cvr;
|
||||||
ticks += interval;
|
ticks += interval;
|
||||||
tc->ticks = ticks;
|
tc->ticks = ticks;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user