Skip to content
This repository was archived by the owner on Oct 1, 2021. It is now read-only.

Commit be4f68e

Browse files
author
Andrew Tridgell
committed
px4io: only check SAFETY_OFF for allowing RC config changes and reboot
If we check OUTPUTS_ARMED then we can't update trim values and scaling in flight, as there is no way to clear OUTPUTS_ARMED. If safety is on then it should be perfectly safe to update the mixer and RC config or reboot for fw update
1 parent 61f51a6 commit be4f68e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/modules/px4iofirmware/registers.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ registers_set(uint8_t page, uint8_t offset, const uint16_t *values, unsigned num
412412
* text handling function.
413413
*/
414414
return mixer_handle_text(values, num_values * sizeof(*values));
415-
break;
416415

417416
default:
418417
/* avoid offset wrap */
@@ -584,10 +583,7 @@ registers_set_one(uint8_t page, uint8_t offset, uint16_t value)
584583
break;
585584

586585
case PX4IO_P_SETUP_REBOOT_BL:
587-
// do not reboot if FMU is armed and IO's safety is off
588-
// this state defines an active system.
589-
if ((r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF) &&
590-
(r_status_flags & PX4IO_P_SETUP_ARMING_FMU_ARMED)) {
586+
if (r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF) {
591587
// don't allow reboot while armed
592588
break;
593589
}
@@ -633,12 +629,9 @@ registers_set_one(uint8_t page, uint8_t offset, uint16_t value)
633629
case PX4IO_PAGE_RC_CONFIG: {
634630

635631
/**
636-
* do not allow a RC config change while outputs armed
637-
* = FMU is armed and IO's safety is off
638-
* this state defines an active system.
632+
* do not allow a RC config change while safety is off
639633
*/
640-
if ((r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF) &&
641-
(r_status_flags & PX4IO_P_SETUP_ARMING_FMU_ARMED)) {
634+
if (r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF) {
642635
break;
643636
}
644637

0 commit comments

Comments
 (0)