mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +08:00
drivers/rc_input: always report new lock
This commit is contained in:
committed by
David Sidrane
parent
34483aef0f
commit
98f89aae9b
@@ -246,6 +246,8 @@ void RCInput::set_rc_scan_state(RC_SCAN newState)
|
|||||||
_rc_scan_begin = 0;
|
_rc_scan_begin = 0;
|
||||||
_rc_scan_state = newState;
|
_rc_scan_state = newState;
|
||||||
_rc_scan_locked = false;
|
_rc_scan_locked = false;
|
||||||
|
|
||||||
|
_report_lock = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RCInput::rc_io_invert(bool invert)
|
void RCInput::rc_io_invert(bool invert)
|
||||||
@@ -388,11 +390,6 @@ void RCInput::Run()
|
|||||||
|
|
||||||
unsigned frame_drops = 0;
|
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;
|
int newBytes = 0;
|
||||||
|
|
||||||
// TODO: needs work (poll _rcs_fd)
|
// 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)) {
|
} else if (!rc_updated && ((hrt_absolute_time() - _rc_in.timestamp_last_signal) > 1_s)) {
|
||||||
_rc_scan_locked = false;
|
_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]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user