mirror of
https://github.com/espressif/esp-idf.git
synced 2026-05-04 20:05:25 +02:00
freertos: Update SMP idle hooks
This commit updates the usage of idle hooks in SMP FreeRTOS as follows: - IDF style idle hooks are now called from vApplicationMinimalIdleHook() - If the user provdies their own vApplicationMinimalIdleHook(), it can be wrapped using -Wl,--wrap if CONFIG_FREERTOS_USE_MINIMAL_IDLE_HOOK is enabled. - SMP port no longer uses vApplicationIdleHook() as it's only called from the prvIdleTask() and not every prvMinimalIdleTask()
This commit is contained in:
+5
-1
@@ -148,7 +148,7 @@ This file get's pulled into assembly sources. Therefore, some includes need to b
|
||||
#endif
|
||||
#define configUSE_CORE_AFFINITY 1
|
||||
#define configRUN_MULTIPLE_PRIORITIES 1
|
||||
#define configUSE_MINIMAL_IDLE_HOOK 1
|
||||
#define configUSE_MINIMAL_IDLE_HOOK 1 // This is always enabled to call IDF style idle hooks, by can be "--Wl,--wrap" if users enable CONFIG_FREERTOS_USE_MINIMAL_IDLE_HOOK
|
||||
|
||||
// ------------- Synchronization Primitives ----------------
|
||||
|
||||
@@ -183,7 +183,11 @@ This file get's pulled into assembly sources. Therefore, some includes need to b
|
||||
|
||||
// ------------------------ Hooks --------------------------
|
||||
|
||||
#if CONFIG_FREERTOS_USE_IDLE_HOOK
|
||||
#define configUSE_IDLE_HOOK 1
|
||||
#else
|
||||
#define configUSE_IDLE_HOOK 0
|
||||
#endif
|
||||
#define configUSE_TICK_HOOK 1
|
||||
#if CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE
|
||||
#define configCHECK_FOR_STACK_OVERFLOW 0
|
||||
|
||||
@@ -613,19 +613,24 @@ void vApplicationTickHook( void )
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ( configUSE_IDLE_HOOK == 1 )
|
||||
void vApplicationIdleHook( void )
|
||||
#if CONFIG_FREERTOS_USE_MINIMAL_IDLE_HOOK
|
||||
/*
|
||||
By default, the port uses vApplicationMinimalIdleHook() to run IDF style idle
|
||||
hooks. However, users may also want to provide their own vApplicationMinimalIdleHook().
|
||||
In this case, we use to -Wl,--wrap option to wrap the user provided vApplicationMinimalIdleHook()
|
||||
*/
|
||||
extern void __real_vApplicationMinimalIdleHook( void );
|
||||
void __wrap_vApplicationMinimalIdleHook( void )
|
||||
{
|
||||
esp_vApplicationIdleHook();
|
||||
esp_vApplicationIdleHook(); //Run IDF style hooks
|
||||
__real_vApplicationMinimalIdleHook(); //Call the user provided vApplicationMinimalIdleHook()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ( configUSE_MINIMAL_IDLE_HOOK == 1 )
|
||||
#else // CONFIG_FREERTOS_USE_MINIMAL_IDLE_HOOK
|
||||
void vApplicationMinimalIdleHook( void )
|
||||
{
|
||||
esp_vApplicationIdleHook();
|
||||
esp_vApplicationIdleHook(); //Run IDF style hooks
|
||||
}
|
||||
#endif
|
||||
#endif // CONFIG_FREERTOS_USE_MINIMAL_IDLE_HOOK
|
||||
|
||||
/* ---------------------------------------------- Misc Implementations -------------------------------------------------
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user