mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-10 06:39:25 +08:00
refactor(control_allocator): reorder inequality to avoid uint wrapping
and add unit to variable name
This commit is contained in:
@@ -168,7 +168,7 @@ void ActuatorGroupPreflightCheck::updateState(hrt_abstime now)
|
||||
}
|
||||
}
|
||||
|
||||
if (now - _started >= PREFLIGHT_CHECK_DURATION) {
|
||||
if (now >= _started + PREFLIGHT_CHECK_DURATION_US) {
|
||||
_running = false;
|
||||
sendAck(_last_command, vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED, now);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
ActuatorEffectiveness &effectiveness);
|
||||
|
||||
private:
|
||||
static constexpr hrt_abstime PREFLIGHT_CHECK_DURATION = 500'000; // 500 ms
|
||||
static constexpr hrt_abstime PREFLIGHT_CHECK_DURATION_US = 500'000; // 500 ms
|
||||
|
||||
static bool isThrust(uint8_t group);
|
||||
static bool isKnownGroup(uint8_t group);
|
||||
|
||||
Reference in New Issue
Block a user