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/nuttx.git
commit 7cb9b078029eb844eeeebdb82ff36be234ef8a97 Author: buxiasen <[email protected]> AuthorDate: Tue Oct 8 12:22:09 2024 +0800 board/arm/nrf52: fix use up_interrupt_context to is_nesting_interrupt The case want to determine if a interrupt with higher priority and the interrupt preemption occurred, but up_interrupt_context indicates that we self inside interrupt/handler mode. As we previously did not handle the ramvector interrupt correctly, after update breaked the case. We should use a more clear private function is_nesting_interrupt. Signed-off-by: buxiasen <[email protected]> --- boards/arm/nrf52/nrf52840-dk/src/nrf52_highpri.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/boards/arm/nrf52/nrf52840-dk/src/nrf52_highpri.c b/boards/arm/nrf52/nrf52840-dk/src/nrf52_highpri.c index f926bccf7e..9036c79caf 100644 --- a/boards/arm/nrf52/nrf52840-dk/src/nrf52_highpri.c +++ b/boards/arm/nrf52/nrf52840-dk/src/nrf52_highpri.c @@ -96,6 +96,11 @@ static struct highpri_s g_highpri; * Private Functions ****************************************************************************/ +static inline_function bool is_nesting_interrupt(void) +{ + return up_current_regs() != NULL; +} + /**************************************************************************** * Name: timer_handler * @@ -126,7 +131,7 @@ void timer_handler(void) /* Check if we are in an interrupt handle */ - if (up_interrupt_context()) + if (is_nesting_interrupt()) { g_highpri.handler++; }
