Teensy 4.1 core updated for C++20
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

irq.h 745B

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. }