diff --git a/components/esp32/freertos_hooks.c b/components/esp32/freertos_hooks.c index d59a20363d..6cea80b9d8 100644 --- a/components/esp32/freertos_hooks.c +++ b/components/esp32/freertos_hooks.c @@ -16,6 +16,7 @@ #include #include #include +#include "freertos/FreeRTOS.h" #include "esp_attr.h" #include "esp_freertos_hooks.h" @@ -23,15 +24,16 @@ //an idle or tick hook. #define MAX_HOOKS 8 -static esp_freertos_idle_cb_t idle_cb[MAX_HOOKS]={0}; -static esp_freertos_tick_cb_t tick_cb[MAX_HOOKS]={0}; +static esp_freertos_idle_cb_t idle_cb[portNUM_PROCESSORS][MAX_HOOKS]={0}; +static esp_freertos_tick_cb_t tick_cb[portNUM_PROCESSORS][MAX_HOOKS]={0}; void IRAM_ATTR esp_vApplicationTickHook() { int n; + int core = xPortGetCoreID(); for (n=0; n