Skip to content

Commit

Permalink
board/arm/nrf52: fix use up_interrupt_context to do parent_in_interrupt
Browse files Browse the repository at this point in the history
The case want to determine if a interrupt with higher priority the
interrupt preemption occurred, but up_interrupt_context indicates that we
self inside interrupt/handedr mode. As we previously did not handle the
ramvector interrupt correctly, after update breaked the case. We should
use a more clear private function parent_in_interrupt.

Signed-off-by: buxiasen <[email protected]>
  • Loading branch information
jasonbu committed Oct 8, 2024
1 parent 4e5a963 commit f05b698
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 parent_in_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 (parent_in_interrupt())
{
g_highpri.handler++;
}
Expand Down

0 comments on commit f05b698

Please sign in to comment.