mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
drivers/rc_input: always report new lock
This commit is contained in:
parent
34483aef0f
commit
98f89aae9b
@ -246,6 +246,8 @@ void RCInput::set_rc_scan_state(RC_SCAN newState)
|
||||
_rc_scan_begin = 0;
|
||||
_rc_scan_state = newState;
|
||||
_rc_scan_locked = false;
|
||||
|
||||
_report_lock = true;
|
||||
}
|
||||
|
||||
void RCInput::rc_io_invert(bool invert)
|
||||
@ -388,11 +390,6 @@ void RCInput::Run()
|
||||
|
||||
unsigned frame_drops = 0;
|
||||
|
||||
if (_report_lock && _rc_scan_locked) {
|
||||
_report_lock = false;
|
||||
PX4_INFO("RC scan: %s RC input locked", RC_SCAN_STRING[_rc_scan_state]);
|
||||
}
|
||||
|
||||
int newBytes = 0;
|
||||
|
||||
// TODO: needs work (poll _rcs_fd)
|
||||
@ -704,6 +701,11 @@ void RCInput::Run()
|
||||
} else if (!rc_updated && ((hrt_absolute_time() - _rc_in.timestamp_last_signal) > 1_s)) {
|
||||
_rc_scan_locked = false;
|
||||
}
|
||||
|
||||
if (_report_lock && _rc_scan_locked) {
|
||||
_report_lock = false;
|
||||
PX4_INFO("RC scan: %s RC input locked", RC_SCAN_STRING[_rc_scan_state]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user