aboutsummaryrefslogtreecommitdiff
path: root/apps/px4io/registers.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/px4io/registers.c')
-rw-r--r--apps/px4io/registers.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/px4io/registers.c b/apps/px4io/registers.c
index d97fd8d86..511a47f8d 100644
--- a/apps/px4io/registers.c
+++ b/apps/px4io/registers.c
@@ -361,6 +361,13 @@ registers_set_one(uint8_t page, uint8_t offset, uint16_t value)
break;
case PX4IO_PAGE_RC_CONFIG: {
+
+ /* do not allow a RC config change while fully armed */
+ if (/* FMU is armed */ (r_setup_arming & PX4IO_P_SETUP_ARMING_ARM_OK) &&
+ /* IO is armed */ (r_status_flags & PX4IO_P_STATUS_FLAGS_ARMED)) {
+ break;
+ }
+
unsigned channel = offset / PX4IO_P_RC_CONFIG_STRIDE;
unsigned index = offset - channel * PX4IO_P_RC_CONFIG_STRIDE;
uint16_t *conf = &r_page_rc_input_config[channel * PX4IO_P_RC_CONFIG_STRIDE];