From 92d5f9989ad0c0f740d70167966a3d937d272fbb Mon Sep 17 00:00:00 2001 From: Dimitris Mantzouranis Date: Wed, 12 Oct 2022 21:17:08 +0300 Subject: [PATCH] common chconf.h: allow custom idle hooks --- platforms/chibios/boards/common/configs/chconf.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platforms/chibios/boards/common/configs/chconf.h b/platforms/chibios/boards/common/configs/chconf.h index 5db836e37c2b..4fa00a3f6c7a 100644 --- a/platforms/chibios/boards/common/configs/chconf.h +++ b/platforms/chibios/boards/common/configs/chconf.h @@ -749,20 +749,22 @@ * should be invoked from here. * @note This macro can be used to activate a power saving mode. */ +#if !defined(CH_CFG_IDLE_ENTER_HOOK) #define CH_CFG_IDLE_ENTER_HOOK() { \ /* Idle-enter code here.*/ \ } - +#endif /** * @brief Idle thread leave hook. * @note This hook is invoked within a critical zone, no OS functions * should be invoked from here. * @note This macro can be used to deactivate a power saving mode. */ +#if !defined(CH_CFG_IDLE_LEAVE_HOOK) #define CH_CFG_IDLE_LEAVE_HOOK() { \ /* Idle-leave code here.*/ \ } - +#endif /** * @brief Idle Loop hook. * @details This hook is continuously invoked by the idle thread loop.