[PATCH] Implementation for STM32 HAL_GetTick using RTEMS

Robin Mueller robin.mueller.m at gmail.com
Mon Apr 26 09:20:32 UTC 2021


Uses configured millisecond per ticks
---
 bsps/arm/stm32h7/start/bspstart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/bsps/arm/stm32h7/start/bspstart.c b/bsps/arm/stm32h7/start/bspstart.c
index 7ae39f1410..75af44352f 100644
--- a/bsps/arm/stm32h7/start/bspstart.c
+++ b/bsps/arm/stm32h7/start/bspstart.c
@@ -35,8 +35,7 @@
 /* Get number of milliseconds elapsed since startup */
 uint32_t HAL_GetTick(void)
 {
-  uint64_t temp = rtems_clock_get_uptime_nanoseconds() / (1000 * 1000);
-  return temp;
+  return rtems_clock_get_ticks_since_boot() * rtems_configuration_get_milliseconds_per_tick();
 }
 
 uint32_t stm32h7_systick_frequency(void)
-- 
2.25.1



More information about the devel mailing list