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 <buxiasen@xiaomi.com>
This commit is contained in:
buxiasen 2024-10-08 12:22:09 +08:00 committed by Xiang Xiao
parent 21501f65b1
commit 431b848c79

View File

@ -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++;
}