This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 6f18747dc2bcb9731b5c213b74c5eff035e9ecce Author: Huang Qi <[email protected]> AuthorDate: Thu Feb 10 10:42:48 2022 +0800 risc-v: Add WFI to up_idle and fix compile issue Signed-off-by: Huang Qi <[email protected]> --- arch/risc-v/src/common/riscv_idle.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/risc-v/src/common/riscv_idle.c b/arch/risc-v/src/common/riscv_idle.c index 5e33578..96819e3 100644 --- a/arch/risc-v/src/common/riscv_idle.c +++ b/arch/risc-v/src/common/riscv_idle.c @@ -53,4 +53,13 @@ void up_idle(void) */ nxsched_process_timer(); +#else + + /* This would be an appropriate place to put some MCU-specific logic to + * sleep in a reduced power mode until an interrupt occurs to save power + */ + + asm("WFI"); + +#endif }
