From 77d1f78996d50f07bb0762afeee30bff06ca253a Mon Sep 17 00:00:00 2001 From: buxiasen Date: Tue, 8 Oct 2024 16:47:30 +0800 Subject: [PATCH] board/arm/stm32: highpri up_interrupt_context to is_nesting_interrupt up_interrupt_context indicates that we self inside interrupt/handler mode, replaced to private function is_nesting_interrupt to make less confused. Signed-off-by: buxiasen --- boards/arm/stm32/viewtool-stm32f107/src/stm32_highpri.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/boards/arm/stm32/viewtool-stm32f107/src/stm32_highpri.c b/boards/arm/stm32/viewtool-stm32f107/src/stm32_highpri.c index 07c1c5262a1..c095fc32844 100644 --- a/boards/arm/stm32/viewtool-stm32f107/src/stm32_highpri.c +++ b/boards/arm/stm32/viewtool-stm32f107/src/stm32_highpri.c @@ -103,6 +103,11 @@ static struct highpri_s g_highpri; * Private Functions ****************************************************************************/ +static inline_function bool is_nesting_interrupt(void) +{ + return up_current_regs() != NULL; +} + /**************************************************************************** * Name: tim6_handler * @@ -128,7 +133,7 @@ void tim6_handler(void) /* Check if we are in an interrupt handle */ - if (up_interrupt_context()) + if (is_nesting_interrupt()) { g_highpri.handler++; }