From ca775beccb86f52bd9858af9a835257652530c78 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Wed, 19 May 2021 17:48:30 +0900 Subject: [PATCH] boards: spresense: Support board_reset on interrupt context When CONFIG_BOARD_RESET_ON_ASSERT is enabled, board_reset() may be called on interrupt context. This commit changes to be able to call the function on interrupt context. --- boards/arm/cxd56xx/spresense/src/cxd56_power.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/boards/arm/cxd56xx/spresense/src/cxd56_power.c b/boards/arm/cxd56xx/spresense/src/cxd56_power.c index b957a3e6a7..b28383777b 100644 --- a/boards/arm/cxd56xx/spresense/src/cxd56_power.c +++ b/boards/arm/cxd56xx/spresense/src/cxd56_power.c @@ -509,9 +509,12 @@ int board_reset(int status) { /* Restore the original state for bootup after power cycle */ - board_xtal_power_control(true); - board_flash_power_control(true); - up_pm_acquire_freqlock(&g_hv_lock); + if (!up_interrupt_context()) + { + board_xtal_power_control(true); + board_flash_power_control(true); + up_pm_acquire_freqlock(&g_hv_lock); + } /* System reboot */