Skip to content

Commit

Permalink
move the prototype for vApplicationIdleHook to task.h. (#600)
Browse files Browse the repository at this point in the history
Co-authored-by: pluess <[email protected]>
Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]>
  • Loading branch information
3 people authored Dec 19, 2022
1 parent 99d3d54 commit 6d65558
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
18 changes: 18 additions & 0 deletions include/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 )

/**
Expand Down
8 changes: 1 addition & 7 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 6d65558

Please sign in to comment.