From a196e73842259152595d524b150a611076ca91d0 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 5 Feb 2013 18:11:59 +0100 Subject: [PATCH 1/2] Fixed arm ok flag typo --- apps/drivers/px4io/px4io.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/drivers/px4io/px4io.cpp b/apps/drivers/px4io/px4io.cpp index f948fec2c4..2a0d72c310 100644 --- a/apps/drivers/px4io/px4io.cpp +++ b/apps/drivers/px4io/px4io.cpp @@ -541,9 +541,9 @@ PX4IO::io_set_arming_state() clear |= PX4IO_P_SETUP_ARMING_VECTOR_FLIGHT_OK; } if (vstatus.flag_external_manual_override_ok) { - set |= PX4IO_P_SETUP_ARMING_MANUAL_OVERRIDE; + set |= PX4IO_P_FEAT_ARMING_MANUAL_OVERRIDE_OK; } else { - clear |= PX4IO_P_SETUP_ARMING_MANUAL_OVERRIDE; + clear |= PX4IO_P_FEAT_ARMING_MANUAL_OVERRIDE_OK; } return io_reg_modify(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_ARMING, clear, set); @@ -1214,6 +1214,10 @@ monitor(void) int px4io_main(int argc, char *argv[]) { + /* check for sufficient number of arguments */ + if (argc < 2) + goto out; + if (!strcmp(argv[1], "start")) { if (g_dev != nullptr) @@ -1330,5 +1334,6 @@ px4io_main(int argc, char *argv[]) if (!strcmp(argv[1], "monitor")) monitor(); + out: errx(1, "need a command, try 'start', 'stop', 'status', 'test', 'monitor' or 'update'"); } From 167ec25c4f04ceed699a20fd6490db6cdf74e223 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 5 Feb 2013 18:28:41 +0100 Subject: [PATCH 2/2] Fixed altitude jump issue, hunted down and fix by Andrew Tridgell. --- apps/drivers/ms5611/ms5611.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/drivers/ms5611/ms5611.cpp b/apps/drivers/ms5611/ms5611.cpp index 231006ae3d..30166828a5 100644 --- a/apps/drivers/ms5611/ms5611.cpp +++ b/apps/drivers/ms5611/ms5611.cpp @@ -331,8 +331,9 @@ MS5611::probe() if ((OK == probe_address(MS5611_ADDRESS_1)) || (OK == probe_address(MS5611_ADDRESS_2))) { - /* - * Disable retries; the device gets confused if we retry some of the commands. + /* + * Disable retries; we may enable them selectively in some cases, + * but the device gets confused if we retry some of the commands. */ _retries = 0; return OK; @@ -653,7 +654,11 @@ MS5611::measure() /* * Send the command to begin measuring. + * + * Disable retries on this command; we can't know whether failure + * means the device did or did not see the write. */ + _retries = 0; ret = transfer(&cmd_data, 1, nullptr, 0); if (OK != ret)