diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-06-04 14:13:02 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-06-04 14:13:02 +0200 |
commit | de82295ab5307bca0fbd2266fdd1547386fa19a8 (patch) | |
tree | 98cb0a865efb69f3717b0f58cff31f9e9bcc2f9e /src/systemcmds | |
parent | 40dbd21e11162c9d728852e98d1dfb5003a85538 (diff) | |
download | px4-firmware-de82295ab5307bca0fbd2266fdd1547386fa19a8.tar.gz px4-firmware-de82295ab5307bca0fbd2266fdd1547386fa19a8.tar.bz2 px4-firmware-de82295ab5307bca0fbd2266fdd1547386fa19a8.zip |
HOTFIX: Allow PWM command to correctly set ARM_OK flag
Diffstat (limited to 'src/systemcmds')
-rw-r--r-- | src/systemcmds/pwm/pwm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/systemcmds/pwm/pwm.c b/src/systemcmds/pwm/pwm.c index ff733df52..e150b5a74 100644 --- a/src/systemcmds/pwm/pwm.c +++ b/src/systemcmds/pwm/pwm.c @@ -185,12 +185,18 @@ pwm_main(int argc, char *argv[]) const char *arg = argv[0]; argv++; if (!strcmp(arg, "arm")) { + /* tell IO that its ok to disable its safety with the switch */ + ret = ioctl(fd, PWM_SERVO_SET_ARM_OK, 0); + if (ret != OK) + err(1, "PWM_SERVO_SET_ARM_OK"); + /* tell IO that the system is armed (it will output values if safety is off) */ ret = ioctl(fd, PWM_SERVO_ARM, 0); if (ret != OK) err(1, "PWM_SERVO_ARM"); continue; } if (!strcmp(arg, "disarm")) { + /* disarm, but do not revoke the SET_ARM_OK flag */ ret = ioctl(fd, PWM_SERVO_DISARM, 0); if (ret != OK) err(1, "PWM_SERVO_DISARM"); |