mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 08:41:35 +08:00
px4iofirmware: convert atomic macro into methods
Reduces flash size by 744 bytes. CPU (loop time) is not affected.
This commit is contained in:
@@ -186,11 +186,9 @@ extern output_limit_t pwm_limit;
|
||||
|
||||
#define PX4_CRITICAL_SECTION(cmd) { irqstate_t flags = px4_enter_critical_section(); cmd; px4_leave_critical_section(flags); }
|
||||
|
||||
#define PX4_ATOMIC_MODIFY_OR(target, modification) { if ((target | (modification)) != target) { PX4_CRITICAL_SECTION(target |= (modification)); } }
|
||||
|
||||
#define PX4_ATOMIC_MODIFY_CLEAR(target, modification) { if ((target & ~(modification)) != target) { PX4_CRITICAL_SECTION(target &= ~(modification)); } }
|
||||
|
||||
#define PX4_ATOMIC_MODIFY_AND(target, modification) { if ((target & (modification)) != target) { PX4_CRITICAL_SECTION(target &= (modification)); } }
|
||||
void atomic_modify_or(volatile uint16_t *target, uint16_t modification);
|
||||
void atomic_modify_clear(volatile uint16_t *target, uint16_t modification);
|
||||
void atomic_modify_and(volatile uint16_t *target, uint16_t modification);
|
||||
|
||||
/*
|
||||
* Mixer
|
||||
|
||||
Reference in New Issue
Block a user