FMU driver: Ensure correct binding pulses for Spektrum, time out any receiver which has more than one second no signal.

This commit is contained in:
Lorenz Meier 2016-10-08 16:56:04 +02:00
parent 9d2b5b1c28
commit 4cfd84b56a
1 changed files with 4 additions and 0 deletions

View File

@ -1487,6 +1487,8 @@ PX4FMU::cycle()
} else {
orb_publish(ORB_ID(input_rc), _to_input_rc, &_rc_in);
}
} else if (!rc_updated && ((hrt_absolute_time() - _rc_in.timestamp_last_signal) > 1000 * 1000)) {
_rc_scan_locked = false;
}
work_queue(HPWORK, &_work, (worker_t)&PX4FMU::cycle_trampoline, this,
@ -2121,7 +2123,9 @@ PX4FMU::pwm_ioctl(file *filp, int cmd, unsigned long arg)
dsm_bind(DSM_CMD_BIND_POWER_UP, 0);
usleep(72000);
irqstate_t flags = px4_enter_critical_section();
dsm_bind(DSM_CMD_BIND_SEND_PULSES, arg);
px4_leave_critical_section(flags);
usleep(50000);
dsm_bind(DSM_CMD_BIND_REINIT_UART, 0);