From 7482557df4d527ee64afd556c15a5178a3d75579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=90=83=E6=B2=B9=E7=82=B8=E9=B8=A1?= <1425962791@qq.com> Date: Tue, 12 Aug 2025 18:47:42 +0800 Subject: [PATCH] add tick hook --- Power_Pico/Core/Src/freertos.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Power_Pico/Core/Src/freertos.c b/Power_Pico/Core/Src/freertos.c index d62d6c3..69dcecc 100644 --- a/Power_Pico/Core/Src/freertos.c +++ b/Power_Pico/Core/Src/freertos.c @@ -64,6 +64,21 @@ void StartDefaultTask(void *argument); void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */ +/* Hook prototypes */ +void vApplicationTickHook(void); + +/* USER CODE BEGIN 3 */ +void vApplicationTickHook( void ) +{ + /* This function will be called by each tick interrupt if + configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be + added here, but the tick hook is called from an interrupt context, so + code must not attempt to block, and only the interrupt safe FreeRTOS API + functions can be used (those that end in FromISR()). */ + TaskTickHook(); +} +/* USER CODE END 3 */ + /** * @brief FreeRTOS initialization * @param None