diff options
author | Jonathan Challinger <mr.challinger@gmail.com> | 2015-01-28 17:10:25 -0800 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-02-01 13:12:21 +0100 |
commit | f7d875d58d1286f9a3c63482772f4addbaf74eb0 (patch) | |
tree | 3db1508640c63ba382a46e5b6f8424d290eed488 /src/drivers/px4io/px4io.cpp | |
parent | 344e9694289a12a8e962a589c99000ed9dab5928 (diff) | |
download | px4-firmware-f7d875d58d1286f9a3c63482772f4addbaf74eb0.tar.gz px4-firmware-f7d875d58d1286f9a3c63482772f4addbaf74eb0.tar.bz2 px4-firmware-f7d875d58d1286f9a3c63482772f4addbaf74eb0.zip |
px4io: add safety_arm and safety_disarm commands
This will be used to make updating firmware on boot for vehicles with
no safety switch possible without power cycling. The startup script
needs to be able to force safety on to allow the reboot to work.
Diffstat (limited to 'src/drivers/px4io/px4io.cpp')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 653d0d5d7..3b42afb6c 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -3267,7 +3267,23 @@ px4io_main(int argc, char *argv[]) exit(0); } + if (!strcmp(argv[1], "safety_arm")) { + int ret = g_dev->ioctl(NULL, PWM_SERVO_SET_FORCE_SAFETY_OFF, 0); + if (ret != OK) { + printf("failed to arm px4io\n"); + exit(1); + } + exit(0); + } + if (!strcmp(argv[1], "safety_disarm")) { + int ret = g_dev->ioctl(NULL, PWM_SERVO_SET_FORCE_SAFETY_ON, 0); + if (ret != OK) { + printf("failed to disarm px4io\n"); + exit(1); + } + exit(0); + } if (!strcmp(argv[1], "recovery")) { @@ -3396,6 +3412,6 @@ px4io_main(int argc, char *argv[]) out: errx(1, "need a command, try 'start', 'stop', 'status', 'test', 'monitor', 'debug <level>',\n" - "'recovery', 'limit <rate>', 'current', 'bind', 'checkcrc',\n" + "'recovery', 'limit <rate>', 'current', 'bind', 'checkcrc', 'safety_arm', 'safety_disarm',\n" "'forceupdate', 'update', 'sbus1_out', 'sbus2_out', 'rssi_analog' or 'rssi_pwm'"); } |