Skip to content

Commit

Permalink
Avoid unsigned integer underflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Perrrewi committed Dec 3, 2024
1 parent 8626019 commit 9c3d9ab
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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_telemetry_timeout + esc_status.timestamp) {

checkEscStatus(context, reporter, esc_status);
reporter.setIsPresent(health_component_t::motors_escs);
Expand Down

0 comments on commit 9c3d9ab

Please sign in to comment.