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.
This commit is contained in:
SPRESENSE 2021-05-19 17:48:30 +09:00 committed by Alin Jerpelea
parent 8b5425d661
commit ca775beccb

View File

@ -509,9 +509,12 @@ int board_reset(int status)
{ {
/* Restore the original state for bootup after power cycle */ /* Restore the original state for bootup after power cycle */
board_xtal_power_control(true); if (!up_interrupt_context())
board_flash_power_control(true); {
up_pm_acquire_freqlock(&g_hv_lock); board_xtal_power_control(true);
board_flash_power_control(true);
up_pm_acquire_freqlock(&g_hv_lock);
}
/* System reboot */ /* System reboot */