1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-26 13:25:54 +00:00

🧑‍💻 Update HC32 CRITICAL_SECTION macros (#27283)

Fixes #27282
This commit is contained in:
Chris 2024-07-18 04:03:35 +02:00 committed by GitHub
parent 1aca038daf
commit 29a5006df9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -114,22 +114,19 @@
// Misc. Functions
//
#ifndef analogInputToDigitalPin
#define analogInputToDigitalPin(p) pin_t(p)
#define analogInputToDigitalPin(p) pin_t(p)
#endif
#define CRITICAL_SECTION_START \
uint32_t primask = __get_PRIMASK(); \
(void)__iCliRetVal()
#define CRITICAL_SECTION_START() \
const bool irqon = !__get_PRIMASK(); \
__disable_irq(); \
__DSB();
#define CRITICAL_SECTION_END() \
__DSB(); \
if (irqon) __enable_irq();
#define CRITICAL_SECTION_END \
if (!primask) \
(void)__iSeiRetVal()
// Disable interrupts
#define cli() noInterrupts()
// Enable interrupts
#define sei() interrupts()
#define cli() __disable_irq()
#define sei() __enable_irq()
// bss_end alias
#define __bss_end __bss_end__