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

Commit 92e1eef

Browse files
author
Andrew Tridgell
committed
px4io: support PX4IO_P_SETUP_FORCE_SAFETY_OFF
this allows the FMU to force the safety off on the IO board. Useful in two cases: 1) vehicles where the safety switch is impractical or not useful (eg. HAB planes or internal combustion motors) 2) doing ESC calibration on multi-copters
1 parent 859e0cc commit 92e1eef

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/modules/px4iofirmware/protocol.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ enum { /* DSM bind states */
193193

194194
#define PX4IO_P_SETUP_CRC 11 /* get CRC of IO firmware */
195195

196+
#define PX4IO_P_SETUP_FORCE_SAFETY_OFF 12 /* force safety switch into
197+
'armed' (PWM enabled) state */
198+
#define PX4IO_FORCE_SAFETY_MAGIC 22027 /* required argument for force safety (random) */
199+
196200
/* autopilot control values, -10000..10000 */
197201
#define PX4IO_PAGE_CONTROLS 51 /* 0..CONFIG_CONTROL_COUNT */
198202

src/modules/px4iofirmware/registers.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,12 @@ registers_set_one(uint8_t page, uint8_t offset, uint16_t value)
529529
dsm_bind(value & 0x0f, (value >> 4) & 7);
530530
break;
531531

532+
case PX4IO_P_SETUP_FORCE_SAFETY_OFF:
533+
if (value == PX4IO_FORCE_SAFETY_MAGIC) {
534+
r_status_flags |= PX4IO_P_STATUS_FLAGS_SAFETY_OFF;
535+
}
536+
break;
537+
532538
default:
533539
return -1;
534540
}

0 commit comments

Comments
 (0)