Skip to content
Snippets Groups Projects
Commit ac521110 authored by Andrew Tridgell's avatar Andrew Tridgell Committed by Lorenz Meier
Browse files

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
parent 9f2c4b75
No related branches found
No related tags found
No related merge requests found
......@@ -211,6 +211,10 @@ enum { /* DSM bind states */
/* 12 occupied by CRC */
#define PX4IO_P_SETUP_RC_THR_FAILSAFE_US 13 /**< the throttle failsafe pulse length in microseconds */
#define PX4IO_P_SETUP_FORCE_SAFETY_OFF 12 /* force safety switch into
'armed' (PWM enabled) state */
#define PX4IO_FORCE_SAFETY_MAGIC 22027 /* required argument for force safety (random) */
/* autopilot control values, -10000..10000 */
#define PX4IO_PAGE_CONTROLS 51 /**< actuator control groups, one after the other, 8 wide */
#define PX4IO_P_CONTROLS_GROUP_0 (PX4IO_PROTOCOL_MAX_CONTROL_COUNT * 0) /**< 0..PX4IO_PROTOCOL_MAX_CONTROL_COUNT - 1 */
......
......@@ -570,6 +570,12 @@ registers_set_one(uint8_t page, uint8_t offset, uint16_t value)
dsm_bind(value & 0x0f, (value >> 4) & 0xF);
break;
case PX4IO_P_SETUP_FORCE_SAFETY_OFF:
if (value == PX4IO_FORCE_SAFETY_MAGIC) {
r_status_flags |= PX4IO_P_STATUS_FLAGS_SAFETY_OFF;
}
break;
default:
return -1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment