for Kinetis why is __enable_irq and __disable_irq commented out when using CMSIS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

for Kinetis why is __enable_irq and __disable_irq commented out when using CMSIS

1,106 Views
steve_fae
Senior Contributor I

Customer writing code using CMSIS library finds __enable_irq and __disable_irq is commented out.  If that is the case, what is the preferred method for enabling and disabling global interrupts in MKL15 family?

Labels (1)
0 Kudos
Reply
1 Reply

799 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi

Please check here to download the latest KSDK software package for KL15 product.

There provide CMSIS driver and example demo located at..\SDK_2.1_MKL15Z128xxx4\boards\frdmkl25z\cmsis_driver_examples folder.

The CMSIS example driver calls the   void EnableIRQ(IRQn_Type interrupt) function to enable IRQ and call void DisableIRQ(IRQn_Type interrupt) function to disable the IRQ.

The related software function could be found at <fsl_common.h> file.

In fact, both functions are calling below functions at <core_cm0plus.h> file:

/**
  \brief   Enable External Interrupt
  \details Enables a device-specific interrupt in the NVIC interrupt controller.
  \param [in]      IRQn  External interrupt number. Value cannot be negative.
 */
__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
{
  NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
}

/**
  \brief   Disable External Interrupt
  \details Disables a device-specific interrupt in the NVIC interrupt controller.
  \param [in]      IRQn  External interrupt number. Value cannot be negative.
 */
__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
{
  NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
}


Wish it helps.

Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply