px4iofirmware: convert atomic macro into methods

Reduces flash size by 744 bytes.
CPU (loop time) is not affected.
This commit is contained in:
Beat Küng
2019-11-16 11:43:42 +01:00
committed by Lorenz Meier
parent 0f2a7ad2b7
commit d965b928f8
5 changed files with 59 additions and 40 deletions
+2 -2
View File
@@ -119,7 +119,7 @@ safety_check_button(void *arg)
} else if (counter == ARM_COUNTER_THRESHOLD) {
/* switch to armed state */
PX4_ATOMIC_MODIFY_OR(r_status_flags, PX4IO_P_STATUS_FLAGS_SAFETY_OFF);
atomic_modify_or(&r_status_flags, PX4IO_P_STATUS_FLAGS_SAFETY_OFF);
counter++;
}
@@ -130,7 +130,7 @@ safety_check_button(void *arg)
} else if (counter == ARM_COUNTER_THRESHOLD) {
/* change to disarmed state and notify the FMU */
PX4_ATOMIC_MODIFY_CLEAR(r_status_flags, PX4IO_P_STATUS_FLAGS_SAFETY_OFF);
atomic_modify_clear(&r_status_flags, PX4IO_P_STATUS_FLAGS_SAFETY_OFF);
counter++;
}