Function-style critical section macros
This commit is contained in:
@@ -73,8 +73,8 @@ typedef int8_t pin_t;
|
||||
#define analogInputToDigitalPin(p) ((p < 12u) ? (p) + 54u : -1)
|
||||
#endif
|
||||
|
||||
#define CRITICAL_SECTION_START uint32_t primask = __get_primask(); __disable_irq()
|
||||
#define CRITICAL_SECTION_END if (!primask) __enable_irq()
|
||||
#define CRITICAL_SECTION_START() uint32_t primask = __get_primask(); __disable_irq()
|
||||
#define CRITICAL_SECTION_END() if (!primask) __enable_irq()
|
||||
#define ISRS_ENABLED() (!__get_primask())
|
||||
#define ENABLE_ISRS() __enable_irq()
|
||||
#define DISABLE_ISRS() __disable_irq()
|
||||
|
Reference in New Issue
Block a user