From 9cf1cbb0575387d79b496b6ff14736ca9239c0a1 Mon Sep 17 00:00:00 2001
From: Damien George <damien.p.george@gmail.com>
Date: Wed, 22 May 2019 12:46:09 +1000
Subject: [PATCH] nrf/mphalport: Use wfi to save power while waiting at the
 UART REPL.

---
 ports/nrf/mphalport.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ports/nrf/mphalport.c b/ports/nrf/mphalport.c
index 9ce904514..a050df147 100644
--- a/ports/nrf/mphalport.c
+++ b/ports/nrf/mphalport.c
@@ -58,6 +58,7 @@ int mp_hal_stdin_rx_chr(void) {
         if (MP_STATE_PORT(board_stdio_uart) != NULL && uart_rx_any(MP_STATE_PORT(board_stdio_uart))) {
             return uart_rx_char(MP_STATE_PORT(board_stdio_uart));
         }
+        __WFI();
     }
 
     return 0;
-- 
GitLab