[rtems commit] bsps/arm: Fix ARMv7-M CPU counter

Sebastian Huber sebh at rtems.org
Tue Apr 9 05:32:13 UTC 2019


Module:    rtems
Branch:    master
Commit:    b8a0a49672e45ba91d42c98a6c2601cc254edb1c
Changeset: http://git.rtems.org/rtems/commit/?id=b8a0a49672e45ba91d42c98a6c2601cc254edb1c

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Apr  8 11:59:29 2019 +0200

bsps/arm: Fix ARMv7-M CPU counter

Read the current counter value again after we know that we had an
underflow.

Update #3456.

---

 bsps/arm/include/bsp/clock-armv7m.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bsps/arm/include/bsp/clock-armv7m.h b/bsps/arm/include/bsp/clock-armv7m.h
index d635fb0..c570153 100644
--- a/bsps/arm/include/bsp/clock-armv7m.h
+++ b/bsps/arm/include/bsp/clock-armv7m.h
@@ -59,6 +59,7 @@ static uint32_t _ARMV7M_Clock_counter(ARMV7M_Timecounter *tc)
   ticks = tc->ticks;
 
   if ((systick->csr & ARMV7M_SYSTICK_CSR_COUNTFLAG) != 0) {
+    counter = systick->cvr;
     ticks += interval;
     tc->ticks = ticks;
   }




More information about the vc mailing list