您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #ifndef __ASM
  3. #define __ASM __asm
  4. #endif
  5. #ifndef __STATIC_FORCEINLINE
  6. #define __STATIC_FORCEINLINE __attribute__((always_inline)) static inline
  7. #endif
  8. /**
  9. \brief Enable IRQ Interrupts
  10. \details Enables IRQ interrupts by clearing the I-bit in the CPSR.
  11. Can only be executed in Privileged modes.
  12. */
  13. __STATIC_FORCEINLINE void __enable_irq(void)
  14. {
  15. __ASM volatile ("cpsie i" : : : "memory");
  16. }
  17. /**
  18. \brief Disable IRQ Interrupts
  19. \details Disables IRQ interrupts by setting the I-bit in the CPSR.
  20. Can only be executed in Privileged modes.
  21. */
  22. __STATIC_FORCEINLINE void __disable_irq(void)
  23. {
  24. __ASM volatile ("cpsid i" : : : "memory");
  25. }