Browse Source

pwm: added PWM_SERVO_SET_FORCE_SAFETY_OFF ioctl

this allows the safety switch on px4io to be forced off
sbg
Andrew Tridgell 11 years ago committed by Lorenz Meier
parent
commit
ab1939c6a3
  1. 3
      src/drivers/drv_pwm_output.h
  2. 1
      src/drivers/px4fmu/fmu.cpp
  3. 4
      src/drivers/px4io/px4io.cpp

3
src/drivers/drv_pwm_output.h

@ -199,6 +199,9 @@ ORB_DECLARE(output_pwm); @@ -199,6 +199,9 @@ ORB_DECLARE(output_pwm);
/** get the lockdown override flag to enable outputs in HIL */
#define PWM_SERVO_GET_DISABLE_LOCKDOWN _IOC(_PWM_SERVO_BASE, 22)
/** force safety switch off (to disable use of safety switch) */
#define PWM_SERVO_SET_FORCE_SAFETY_OFF _IOC(_PWM_SERVO_BASE, 23)
/*
*
*

1
src/drivers/px4fmu/fmu.cpp

@ -736,6 +736,7 @@ PX4FMU::pwm_ioctl(file *filp, int cmd, unsigned long arg) @@ -736,6 +736,7 @@ PX4FMU::pwm_ioctl(file *filp, int cmd, unsigned long arg)
case PWM_SERVO_SET_ARM_OK:
case PWM_SERVO_CLEAR_ARM_OK:
case PWM_SERVO_SET_FORCE_SAFETY_OFF:
// these are no-ops, as no safety switch
break;

4
src/drivers/px4io/px4io.cpp

@ -2129,6 +2129,10 @@ PX4IO::ioctl(file * filep, int cmd, unsigned long arg) @@ -2129,6 +2129,10 @@ PX4IO::ioctl(file * filep, int cmd, unsigned long arg)
case PWM_SERVO_GET_DISABLE_LOCKDOWN:
*(unsigned *)arg = _lockdown_override;
case PWM_SERVO_SET_FORCE_SAFETY_OFF:
/* force safety swith off */
ret = io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_FORCE_SAFETY_OFF, PX4IO_FORCE_SAFETY_MAGIC);
break;
case DSM_BIND_START:

Loading…
Cancel
Save