Skip to content

Commit

Permalink
board/arm/nrf52: fix use up_interrupt_context to is_nesting_interrupt
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jasonbu committed Oct 8, 2024
1 parent 0b38595 commit cef2962
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion boards/arm/nrf52/nrf52840-dk/src/nrf52_highpri.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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++;
}
Expand Down

0 comments on commit cef2962

Please sign in to comment.