Skip to content

Commit

Permalink
added NVIC_GetEnableIRQ implementation for RV32
Browse files Browse the repository at this point in the history
  • Loading branch information
EricB-ADI committed Oct 24, 2024
1 parent 1d05e78 commit b092297
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Libraries/CMSIS/5.9.0/Core/Include/core_rv32.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ extern "C" {
#ifndef __CORE_CM4_H_DEPENDENT
#define __CORE_CM4_H_DEPENDENT




/* check device defines and use defaults */
#if defined __CHECK_DEVICE_DEFINES
#ifndef __CM4_REV
Expand Down Expand Up @@ -375,7 +378,31 @@ __STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
MXC_EVENT->event1_enable |= (1 << (IRQn - 32));
}
}
/**
\brief Get Interrupt Enable status
\details Returns a device specific interrupt enable status from the NVIC interrupt controller.
\param [in] IRQn Device specific interrupt number.
\return 0 Interrupt is not enabled.
\return 1 Interrupt is enabled.
\note IRQn must not be negative.
*/
__STATIC_INLINE uint32_t NVIC_GetEnableIRQ(IRQn_Type IRQn)
{
if((int32_t)(IRQn) < 0)
{
return 0u;
}

const uint32_t irq_mask = (1 << IRQn);
if(IRQn < 32)
{
return (MXC_INTR->irq0_enable & irq_mask) && (MXC_EVENT->event0_enable && irq_mask) ? 1 : 0;

}

return (MXC_INTR->irq1_enable & irq_mask) && (MXC_EVENT->event1_enable && irq_mask) ? 1 : 0;

}
/** \brief Disable External Interrupt
The function disables a device-specific interrupt in the NVIC interrupt controller.
Expand Down

0 comments on commit b092297

Please sign in to comment.