From 1c7540883fb3d2c1c80ef416724e75acc260e762 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Mon, 21 Oct 2024 15:45:16 +0200 Subject: [PATCH] boards nrf_bsim: Add NVIC_GetPendingIRQ() equivalent Add a substitute for NVIC_GetPendingIRQ() Signed-off-by: Alberto Escolar Piedras --- boards/native/nrf_bsim/common/cmsis/cmsis.c | 5 +++++ boards/native/nrf_bsim/common/cmsis/cmsis.h | 1 + 2 files changed, 6 insertions(+) diff --git a/boards/native/nrf_bsim/common/cmsis/cmsis.c b/boards/native/nrf_bsim/common/cmsis/cmsis.c index e80aea6b4ff..dac5f82e699 100644 --- a/boards/native/nrf_bsim/common/cmsis/cmsis.c +++ b/boards/native/nrf_bsim/common/cmsis/cmsis.c @@ -30,6 +30,11 @@ void NVIC_DisableIRQ(IRQn_Type IRQn) hw_irq_ctrl_disable_irq(CONFIG_NATIVE_SIMULATOR_MCU_N, IRQn); } +uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + return hw_irq_ctrl_is_irq_pending(CONFIG_NATIVE_SIMULATOR_MCU_N, IRQn); +} + void NVIC_EnableIRQ(IRQn_Type IRQn) { hw_irq_ctrl_enable_irq(CONFIG_NATIVE_SIMULATOR_MCU_N, IRQn); diff --git a/boards/native/nrf_bsim/common/cmsis/cmsis.h b/boards/native/nrf_bsim/common/cmsis/cmsis.h index ff9030ca547..2afc6e9ae50 100644 --- a/boards/native/nrf_bsim/common/cmsis/cmsis.h +++ b/boards/native/nrf_bsim/common/cmsis/cmsis.h @@ -30,6 +30,7 @@ void __set_PRIMASK(uint32_t primask); void NVIC_SetPendingIRQ(IRQn_Type IRQn); void NVIC_ClearPendingIRQ(IRQn_Type IRQn); void NVIC_DisableIRQ(IRQn_Type IRQn); +uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn); void NVIC_EnableIRQ(IRQn_Type IRQn); void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority); uint32_t NVIC_GetPriority(IRQn_Type IRQn);