Skip to content

Commit 92d5f99

Browse files
committed
common chconf.h: allow custom idle hooks
1 parent a39707f commit 92d5f99

File tree

1 file changed

+4
-2
lines changed
  • platforms/chibios/boards/common/configs

1 file changed

+4
-2
lines changed

platforms/chibios/boards/common/configs/chconf.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,20 +749,22 @@
749749
* should be invoked from here.
750750
* @note This macro can be used to activate a power saving mode.
751751
*/
752+
#if !defined(CH_CFG_IDLE_ENTER_HOOK)
752753
#define CH_CFG_IDLE_ENTER_HOOK() { \
753754
/* Idle-enter code here.*/ \
754755
}
755-
756+
#endif
756757
/**
757758
* @brief Idle thread leave hook.
758759
* @note This hook is invoked within a critical zone, no OS functions
759760
* should be invoked from here.
760761
* @note This macro can be used to deactivate a power saving mode.
761762
*/
763+
#if !defined(CH_CFG_IDLE_LEAVE_HOOK)
762764
#define CH_CFG_IDLE_LEAVE_HOOK() { \
763765
/* Idle-leave code here.*/ \
764766
}
765-
767+
#endif
766768
/**
767769
* @brief Idle Loop hook.
768770
* @details This hook is continuously invoked by the idle thread loop.

0 commit comments

Comments
 (0)