diff options
author | Jean Cyr <jcyr@dillobits.com> | 2013-07-11 10:36:17 -0400 |
---|---|---|
committer | Jean Cyr <jcyr@dillobits.com> | 2013-07-11 10:36:17 -0400 |
commit | 39b3fc8d32ebaa0a9a01e73399884b007e97b378 (patch) | |
tree | 7e86a1307dccfdb98289cf6b47a47ad5aea6bd99 /src/drivers/px4io | |
parent | 3a76162b08ba6d8a8403aeac1889066964ac244b (diff) | |
download | px4-firmware-39b3fc8d32ebaa0a9a01e73399884b007e97b378.tar.gz px4-firmware-39b3fc8d32ebaa0a9a01e73399884b007e97b378.tar.bz2 px4-firmware-39b3fc8d32ebaa0a9a01e73399884b007e97b378.zip |
Don't leave RX in bind mode on console open fail
Don't leave RX in bind mode in the unlikely eventuality that console
open fails
Diffstat (limited to 'src/drivers/px4io')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 08aef7069..ae56b70b3 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -1696,8 +1696,6 @@ bind(int argc, char *argv[]) else errx(1, "unknown parameter %s, use dsm2 or dsmx", argv[2]); - g_dev->ioctl(nullptr, DSM_BIND_START, pulses); - /* Open console directly to grab CTRL-C signal */ int console = open("/dev/console", O_NONBLOCK | O_RDONLY | O_NOCTTY); if (!console) @@ -1706,6 +1704,8 @@ bind(int argc, char *argv[]) warnx("This command will only bind DSM if satellite VCC (red wire) is controlled by relay 1."); warnx("Press CTRL-C or 'c' when done."); + g_dev->ioctl(nullptr, DSM_BIND_START, pulses); + for (;;) { usleep(500000L); /* Check if user wants to quit */ |