[PATCH] updated HAL_GetTick function

Robin Müller robin.mueller.m at gmail.com
Mon Apr 19 08:51:25 UTC 2021


>From 88ac5780f5597a8bb3bf68c6b37fe6694956faaf Mon Sep 17 00:00:00 2001
From: Robin Mueller <robin.mueller.m at gmail.com>
Date: Mon, 19 Apr 2021 10:39:55 +0200
Subject: [PATCH] updated HAL_GetTick function

Patch text went missing, here is the full version of the patch.
Provides implementation for HAL_GetTick but uses RTEMS.
Accounts for the tick base not being 1ms now
---
 bsps/arm/stm32h7/start/bspstart.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bsps/arm/stm32h7/start/bspstart.c
b/bsps/arm/stm32h7/start/bspstart.c
index 2fc8133cca..e6e995a50c 100644
--- a/bsps/arm/stm32h7/start/bspstart.c
+++ b/bsps/arm/stm32h7/start/bspstart.c
@@ -32,9 +32,10 @@

 #include <stm32h7xx_hal.h>

+/* Get number of milliseconds elapsed since startup */
 uint32_t HAL_GetTick(void)
 {
-  return 0;
+  return (rtems_clock_get_ticks_since_boot() * 1000) /
rtems_clock_get_ticks_per_second();
 }

 uint32_t stm32h7_systick_frequency(void)
-- 
2.29.2.windows.2

On Mon, 19 Apr 2021 at 10:48, Robin Mueller <robin.mueller.m at gmail.com>
wrote:

> diff --git a/bsps/arm/stm32h7/start/bspstart.c
> b/bsps/arm/stm32h7/start/bspstart.c
> index 2fc8133cca..e6e995a50c 100644
> --- a/bsps/arm/stm32h7/start/bspstart.c
> +++ b/bsps/arm/stm32h7/start/bspstart.c
> @@ -32,9 +32,10 @@
>
>  #include <stm32h7xx_hal.h>
>
> +/* Get number of milliseconds elapsed since startup */
>  uint32_t HAL_GetTick(void)
>  {
> -  return 0;
> +  return (rtems_clock_get_ticks_since_boot() * 1000) /
> rtems_clock_get_ticks_per_second();
>  }
>
>  uint32_t stm32h7_systick_frequency(void)
> --
> 2.29.2.windows.2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210419/76a10bf3/attachment.html>


More information about the devel mailing list