diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-16 09:51:23 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-05-16 09:51:23 +0200 |
commit | 4fe0027e7a23fdd425479c98f0167adf596d5743 (patch) | |
tree | 66364a10234c3673a3d1f69dabf2cba89083bd3f /src/drivers/px4io/px4io.cpp | |
parent | b903fc1ed3966400b9a585fd155bf844557fc345 (diff) | |
download | px4-firmware-4fe0027e7a23fdd425479c98f0167adf596d5743.tar.gz px4-firmware-4fe0027e7a23fdd425479c98f0167adf596d5743.tar.bz2 px4-firmware-4fe0027e7a23fdd425479c98f0167adf596d5743.zip |
px4io driver: Only try to upload if we have a non-zero failsafe throttle value
Diffstat (limited to 'src/drivers/px4io/px4io.cpp')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index da454eb85..4099e5522 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -994,13 +994,17 @@ PX4IO::task_main() int32_t failsafe_param_val; param_t failsafe_param = param_find("RC_FAILS_THR"); - if (failsafe_param > 0) { + if (failsafe_param != PARAM_INVALID) { param_get(failsafe_param, &failsafe_param_val); - uint16_t failsafe_thr = failsafe_param_val; - pret = io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_RC_THR_FAILSAFE_US, &failsafe_thr, 1); - if (pret != OK) { - log("failsafe upload failed"); + + if (failsafe_param_val > 0) { + + uint16_t failsafe_thr = failsafe_param_val; + pret = io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_RC_THR_FAILSAFE_US, &failsafe_thr, 1); + if (pret != OK) { + log("failsafe upload failed, FS: %d us", (int)failsafe_thr); + } } } |