mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-14 05:20:36 +08:00
ESC check: Avoid unsigned timestamp underflow in telemtry timeout (#24069)
* Avoid unsigned integer underflow * ESC check: add brackets to timeout for readability --------- Co-authored-by: Matthias Grob <maetugr@gmail.com>
This commit is contained in:
@@ -77,7 +77,7 @@ void EscChecks::checkAndReport(const Context &context, Report &reporter)
|
||||
|
||||
esc_status_s esc_status;
|
||||
|
||||
if (_esc_status_sub.copy(&esc_status) && now - esc_status.timestamp < esc_telemetry_timeout) {
|
||||
if (_esc_status_sub.copy(&esc_status) && (now < esc_status.timestamp + esc_telemetry_timeout)) {
|
||||
|
||||
checkEscStatus(context, reporter, esc_status);
|
||||
reporter.setIsPresent(health_component_t::motors_escs);
|
||||
|
||||
Reference in New Issue
Block a user