mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 09:53:33 +08:00
commander: PreFlightCheck param_find all parameters immediately
- this ensures the relevant parameters are marked active immediately before parameter sync - fixes https://github.com/PX4/Firmware/issues/15872
This commit is contained in:
@@ -68,6 +68,9 @@ bool PreFlightCheck::powerCheck(orb_advert_t *mavlink_log_pub, const vehicle_sta
|
||||
const system_power_s &system_power = system_power_sub.get();
|
||||
|
||||
if (system_power.timestamp != 0) {
|
||||
int32_t required_power_module_count = 0;
|
||||
param_get(param_find("COM_POWER_COUNT"), &required_power_module_count);
|
||||
|
||||
// Check avionics rail voltages (if USB isn't connected)
|
||||
if (!system_power.usb_connected) {
|
||||
float avionics_power_rail_voltage = system_power.voltage5v_v;
|
||||
@@ -94,9 +97,6 @@ bool PreFlightCheck::powerCheck(orb_advert_t *mavlink_log_pub, const vehicle_sta
|
||||
|
||||
const int power_module_count = countSetBits(system_power.brick_valid);
|
||||
|
||||
int32_t required_power_module_count = 0;
|
||||
param_get(param_find("COM_POWER_COUNT"), &required_power_module_count);
|
||||
|
||||
if (power_module_count < required_power_module_count) {
|
||||
success = false;
|
||||
|
||||
@@ -105,7 +105,6 @@ bool PreFlightCheck::powerCheck(orb_advert_t *mavlink_log_pub, const vehicle_sta
|
||||
power_module_count, required_power_module_count);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user