diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-12-14 14:54:02 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-12-14 14:54:02 +0100 |
commit | 10b2dc67e4529759b9dcbef6a18360eba610b5a3 (patch) | |
tree | 6797e237b62b96fdb70f122194133f43082702fb /src | |
parent | 00dc339d2ece42161e36af7cc52c042c4fcec697 (diff) | |
download | px4-firmware-10b2dc67e4529759b9dcbef6a18360eba610b5a3.tar.gz px4-firmware-10b2dc67e4529759b9dcbef6a18360eba610b5a3.tar.bz2 px4-firmware-10b2dc67e4529759b9dcbef6a18360eba610b5a3.zip |
Allow forceupdate in all conditions
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 5d35ecb8d..685a9746d 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -2653,22 +2653,22 @@ px4io_main(int argc, char *argv[]) the user to hold the safety switch down */ if (argc <= 3) { - printf("usage: px4io forceupdate MAGIC filename\n"); + warnx("usage: px4io forceupdate MAGIC filename"); exit(1); } if (g_dev == nullptr) { - printf("px4io is not started\n"); - exit(1); - } - uint16_t arg = atol(argv[2]); - int ret = g_dev->ioctl(nullptr, PX4IO_REBOOT_BOOTLOADER, arg); - if (ret != OK) { - printf("reboot failed - %d\n", ret); - exit(1); - } + warnx("px4io is not started, still attempting upgrade"); + } else { + uint16_t arg = atol(argv[2]); + int ret = g_dev->ioctl(nullptr, PX4IO_REBOOT_BOOTLOADER, arg); + if (ret != OK) { + printf("reboot failed - %d\n", ret); + exit(1); + } - // tear down the px4io instance - delete g_dev; + // tear down the px4io instance + delete g_dev; + } // upload the specified firmware const char *fn[2]; |