How to disable all interrupts

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JaSi_1632926
Level 4
Level 4
Welcome! 25 replies posted 10 replies posted

Hi,

With a PSoC 4 device, I can use CyGlobalIntDisable to disable all interrupts, but how can I achieve the same with a PSoC 6 (m4) device?

Thanks, Jacob

0 Likes
1 Solution
Vison_Zhang
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 250 sign-ins

/* ###########################  Core Function Access  ########################### */

/** \ingroup  CMSIS_Core_FunctionInterface

    \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions

  @{

*/

/**

  \brief   Enable IRQ Interrupts

  \details Enables IRQ interrupts by clearing the I-bit in the CPSR.

           Can only be executed in Privileged modes.

*/

__attribute__((always_inline)) __STATIC_INLINE void __enable_irq(void)

{

  __ASM volatile ("cpsie i" : : : "memory");

}

/**

  \brief   Disable IRQ Interrupts

  \details Disables IRQ interrupts by setting the I-bit in the CPSR.

           Can only be executed in Privileged modes.

*/

__attribute__((always_inline)) __STATIC_INLINE void __disable_irq(void)

{

  __ASM volatile ("cpsid i" : : : "memory");

}

/* ###########################  Core Function Access  ########################### */

View solution in original post

1 Reply
Vison_Zhang
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 250 sign-ins

/* ###########################  Core Function Access  ########################### */

/** \ingroup  CMSIS_Core_FunctionInterface

    \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions

  @{

*/

/**

  \brief   Enable IRQ Interrupts

  \details Enables IRQ interrupts by clearing the I-bit in the CPSR.

           Can only be executed in Privileged modes.

*/

__attribute__((always_inline)) __STATIC_INLINE void __enable_irq(void)

{

  __ASM volatile ("cpsie i" : : : "memory");

}

/**

  \brief   Disable IRQ Interrupts

  \details Disables IRQ interrupts by setting the I-bit in the CPSR.

           Can only be executed in Privileged modes.

*/

__attribute__((always_inline)) __STATIC_INLINE void __disable_irq(void)

{

  __ASM volatile ("cpsid i" : : : "memory");

}

/* ###########################  Core Function Access  ########################### */