Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(CMSIS): Added NVIC_GetEnableIRQ for RV32 #1240

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 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 @@ -394,7 +394,31 @@ __STATIC_INLINE void NVIC_DisableIRQ(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;

}
__STATIC_INLINE void NVIC_EnableEVENT(IRQn_Type EVENT)
{
if (EVENT < 32)
Expand Down
Loading