From 6d65558ba01141d7c50ff6f93a4054cc5f16940e Mon Sep 17 00:00:00 2001 From: tcpluess Date: Mon, 19 Dec 2022 10:48:07 +0100 Subject: [PATCH] move the prototype for vApplicationIdleHook to task.h. (#600) Co-authored-by: pluess Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> --- include/task.h | 18 ++++++++++++++++++ tasks.c | 8 +------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/include/task.h b/include/task.h index a3548296b97..b01551d5366 100644 --- a/include/task.h +++ b/include/task.h @@ -1649,6 +1649,24 @@ configSTACK_DEPTH_TYPE uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) PRIVIL #endif +#if ( configUSE_IDLE_HOOK == 1 ) + +/** + * task.h + * @code{c} + * void vApplicationIdleHook( void ); + * @endcode + * + * The application idle hook is called by the idle task. + * This allows the application designer to add background functionality without + * the overhead of a separate task. + * NOTE: vApplicationIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES, CALL A FUNCTION THAT MIGHT BLOCK. + */ + void vApplicationIdleHook( void ); + +#endif + + #if ( configUSE_TICK_HOOK > 0 ) /** diff --git a/tasks.c b/tasks.c index c9cf459829d..d4d8fb06f2d 100644 --- a/tasks.c +++ b/tasks.c @@ -3477,13 +3477,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters ) #if ( configUSE_IDLE_HOOK == 1 ) { - extern void vApplicationIdleHook( void ); - - /* Call the user defined function from within the idle task. This - * allows the application designer to add background functionality - * without the overhead of a separate task. - * NOTE: vApplicationIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES, - * CALL A FUNCTION THAT MIGHT BLOCK. */ + /* Call the user defined function from within the idle task. */ vApplicationIdleHook(); } #endif /* configUSE_IDLE_HOOK */