forked from Archive/PX4-Autopilot
px4io driver: Only try to upload if we have a non-zero failsafe throttle value
This commit is contained in:
parent
b903fc1ed3
commit
4fe0027e7a
|
@ -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);
|
||||
|
||||
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");
|
||||
log("failsafe upload failed, FS: %d us", (int)failsafe_thr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue