From 723faf08d9bf2580fae0c9992a67528720fc87d7 Mon Sep 17 00:00:00 2001 From: dongheng Date: Thu, 28 Feb 2019 15:30:34 +0800 Subject: [PATCH] feat(freertos): Add option to FreeRTOS sleep module --- components/freertos/Kconfig | 8 ++++++++ components/freertos/freertos/tasks.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/components/freertos/Kconfig b/components/freertos/Kconfig index 0d3eadb1..84efde93 100644 --- a/components/freertos/Kconfig +++ b/components/freertos/Kconfig @@ -61,4 +61,12 @@ config USE_QUEUE_SETS help Enable this option, the FreeRTOS macro "configUSE_QUEUE_SETS" in file "FreeRTOSConfig.h" will be set to be 1. +config ENABLE_FREERTOS_SLEEP + bool "Enable FreeRTOS SLEEP" + default n + help + Enable this option, FreeRTOS sleep module at idle task will be enable. + + The module is not working now, so if users want to make it work, they should do this themselves. + endmenu diff --git a/components/freertos/freertos/tasks.c b/components/freertos/freertos/tasks.c index c86c1daa..a1d355a7 100644 --- a/components/freertos/freertos/tasks.c +++ b/components/freertos/freertos/tasks.c @@ -3310,6 +3310,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters ) } #endif /* configUSE_IDLE_HOOK */ + #if CONFIG_ENABLE_FREERTOS_SLEEP /* This conditional compilation should use inequality to 0, not equality to 1. This is to ensure portSUPPRESS_TICKS_AND_SLEEP() is called when user defined low power mode implementations require @@ -3359,6 +3360,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters ) } } #endif /* configUSE_TICKLESS_IDLE */ + #endif /* CONFIG_ENABLE_FREERTOS_SLEEP */ } } /*-----------------------------------------------------------*/