From 015e95807a44fdc9bfd9b1a4eecf47d541a207ec Mon Sep 17 00:00:00 2001 From: root Date: Tue, 14 Jun 2022 12:14:05 -0500 Subject: [PATCH 1/3] Fix for Issue #6478 --- ports/nrf/boards/clue_nrf52840_express/board.c | 1 + ports/nrf/common-hal/alarm/__init__.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index f2e648f473..06ee622f93 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -102,4 +102,5 @@ void reset_board(void) { } void board_deinit(void) { + common_hal_displayio_release_displays(); } diff --git a/ports/nrf/common-hal/alarm/__init__.c b/ports/nrf/common-hal/alarm/__init__.c index 92dac1c789..c79158e8f1 100644 --- a/ports/nrf/common-hal/alarm/__init__.c +++ b/ports/nrf/common-hal/alarm/__init__.c @@ -48,6 +48,9 @@ #include "nrf_power.h" #include "nrfx.h" #include "nrfx_gpiote.h" +#ifdef NRF_DEBUG_PRINT +void print_wakeup_cause(nrf_sleep_source_t cause); +#endif // Singleton instance of SleepMemory. const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { From 669e45497c83b42a53f9b685d6c429ad06f122eb Mon Sep 17 00:00:00 2001 From: root Date: Tue, 14 Jun 2022 13:27:15 -0500 Subject: [PATCH 2/3] Uncommented call to print_wakeup_cause --- ports/nrf/common-hal/alarm/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/common-hal/alarm/__init__.c b/ports/nrf/common-hal/alarm/__init__.c index c79158e8f1..1acc0c0324 100644 --- a/ports/nrf/common-hal/alarm/__init__.c +++ b/ports/nrf/common-hal/alarm/__init__.c @@ -49,7 +49,7 @@ #include "nrfx.h" #include "nrfx_gpiote.h" #ifdef NRF_DEBUG_PRINT -void print_wakeup_cause(nrf_sleep_source_t cause); +static void print_wakeup_cause(nrf_sleep_source_t cause); #endif // Singleton instance of SleepMemory. @@ -111,7 +111,7 @@ bool common_hal_alarm_woken_from_sleep(void) { nrf_sleep_source_t cause = _get_wakeup_cause(); #ifdef NRF_DEBUG_PRINT if (cause != NRF_SLEEP_WAKEUP_UNDEFINED) { - // print_wakeup_cause(cause); + print_wakeup_cause(cause); } #endif return cause == NRF_SLEEP_WAKEUP_GPIO || cause == NRF_SLEEP_WAKEUP_TIMER From 8668dee3dfe8b9e9bc4ad63ae5ea6d95a15aab4b Mon Sep 17 00:00:00 2001 From: root Date: Tue, 14 Jun 2022 20:51:07 -0500 Subject: [PATCH 3/3] Fix declaration of print_wakeup_cause --- ports/nrf/common-hal/alarm/__init__.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/nrf/common-hal/alarm/__init__.c b/ports/nrf/common-hal/alarm/__init__.c index 1acc0c0324..043be0b319 100644 --- a/ports/nrf/common-hal/alarm/__init__.c +++ b/ports/nrf/common-hal/alarm/__init__.c @@ -48,9 +48,6 @@ #include "nrf_power.h" #include "nrfx.h" #include "nrfx_gpiote.h" -#ifdef NRF_DEBUG_PRINT -static void print_wakeup_cause(nrf_sleep_source_t cause); -#endif // Singleton instance of SleepMemory. const alarm_sleep_memory_obj_t alarm_sleep_memory_obj = { @@ -99,7 +96,7 @@ static const char *cause_str[] = { "VBUS", "RESETPIN", }; -void print_wakeup_cause(nrf_sleep_source_t cause) { +static void print_wakeup_cause(nrf_sleep_source_t cause) { if (cause >= 0 && cause < NRF_SLEEP_WAKEUP_ZZZ) { mp_printf(&mp_plat_print, "wakeup cause = NRF_SLEEP_WAKEUP_%s\r\n", cause_str[(int)cause]);