From 535695f0b97527a1496d31c1e522a34469f8e0bc Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 22 Sep 2017 23:06:52 +0800 Subject: [PATCH] freertos: add frequency switching hooks to ISR and idle task --- components/esp32/freertos_hooks.c | 25 +++++++++++++++---------- components/freertos/xtensa_vectors.S | 4 ++++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/components/esp32/freertos_hooks.c b/components/esp32/freertos_hooks.c index ed88be8835..abe88a97e1 100644 --- a/components/esp32/freertos_hooks.c +++ b/components/esp32/freertos_hooks.c @@ -20,6 +20,10 @@ #include "esp_attr.h" #include "esp_freertos_hooks.h" +#include "sdkconfig.h" +#include "esp_pm.h" +#include "pm_impl.h" + //We use just a static array here because it's not expected many components will need //an idle or tick hook. #define MAX_HOOKS 8 @@ -41,20 +45,21 @@ void IRAM_ATTR esp_vApplicationTickHook() void esp_vApplicationIdleHook() { - bool doWait=true; - bool r; - int n; + bool can_go_idle=true; int core = xPortGetCoreID(); - for (n=0; n