[Cryptech-Commits] [sw/stm32] 01/02: Withdraw SysTick_hook (commit 9ffead1), because it turns out there was already a user-callback mechanism with HAL_SYSTICK_IRQHandler() and HAL_SYSTICK_Callback().

git at cryptech.is git at cryptech.is
Thu Sep 7 20:51:41 UTC 2017


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository sw/stm32.

commit d283110c051fbd20792bedb7bd67239e30c2a29a
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Thu Aug 31 17:37:53 2017 -0400

    Withdraw SysTick_hook (commit 9ffead1), because it turns out there was already a user-callback mechanism with HAL_SYSTICK_IRQHandler() and HAL_SYSTICK_Callback().
---
 .../TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_it.c          | 9 +--------
 projects/hsm/hsm.c                                               | 4 +---
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_it.c b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_it.c
index 4629e44..32b7707 100644
--- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_it.c
+++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_CRYPTECH_ALPHA/stm32f4xx_it.c
@@ -64,13 +64,6 @@ void HardFault_Handler(void)
     while (1) { ; }
 }
 
-static void default_SysTick_hook(void) { };
-static void (*SysTick_hook)(void) = default_SysTick_hook;
-void set_SysTick_hook(void (*hook)(void))
-{
-    SysTick_hook = (hook == NULL) ? default_SysTick_hook : hook;
-}
-
 /**
  * @brief  This function handles SysTick Handler.
  * @param  None
@@ -79,7 +72,7 @@ void set_SysTick_hook(void (*hook)(void))
 void SysTick_Handler(void)
 {
     HAL_IncTick();
-    SysTick_hook();
+    HAL_SYSTICK_IRQHandler();
 }
 
 /******************************************************************************/
diff --git a/projects/hsm/hsm.c b/projects/hsm/hsm.c
index 28a1e68..800edcc 100644
--- a/projects/hsm/hsm.c
+++ b/projects/hsm/hsm.c
@@ -266,7 +266,7 @@ volatile uart_ringbuf_t uart_ringbuf = {0, {0}};
 
 size_t uart_rx_max = 0;
 
-static void uart_rx_task(void)
+void HAL_SYSTICK_Callback(void)
 {
     size_t count = RINGBUF_COUNT(uart_ringbuf);
     if (uart_rx_max < count) uart_rx_max = count;
@@ -438,8 +438,6 @@ int main(void)
         Error_Handler();
 
     /* Start the UART receiver. */
-    extern void set_SysTick_hook(void (*hook)(void));
-    set_SysTick_hook(uart_rx_task);
     if (HAL_UART_Receive_DMA(&huart_user, (uint8_t *) uart_ringbuf.buf, sizeof(uart_ringbuf.buf)) != CMSIS_HAL_OK)
         Error_Handler();
 



More information about the Commits mailing list