forked from Archive/PX4-Autopilot
Commander: move esc_status as local variable.
Signed-off-by: Claudio Micheli <claudio@auterion.com>
This commit is contained in:
parent
5fe7992af5
commit
2eb9fb9ed6
|
@ -22,7 +22,6 @@ bool circuit_breaker_engaged_gpsfailure_check
|
|||
bool circuit_breaker_flight_termination_disabled
|
||||
bool circuit_breaker_engaged_usb_check
|
||||
bool circuit_breaker_engaged_posfailure_check # set to true when the position valid checks have been disabled
|
||||
bool circuit_breaker_engaged_escs_check
|
||||
|
||||
bool offboard_control_signal_found_once
|
||||
bool offboard_control_signal_lost
|
||||
|
|
|
@ -150,7 +150,6 @@ static uint8_t _last_sp_man_arm_switch = 0;
|
|||
|
||||
static struct vtol_vehicle_status_s vtol_status = {};
|
||||
static struct cpuload_s cpuload = {};
|
||||
static struct esc_status_s esc_status = {};
|
||||
|
||||
static bool last_overload = false;
|
||||
|
||||
|
@ -1624,8 +1623,10 @@ Commander::run()
|
|||
|
||||
if (esc_status_sub.updated()) {
|
||||
/* ESCs status changed */
|
||||
esc_status_s esc_status = {};
|
||||
|
||||
esc_status_sub.copy(&esc_status);
|
||||
esc_status_check();
|
||||
esc_status_check(esc_status);
|
||||
}
|
||||
|
||||
estimator_check(&status_changed);
|
||||
|
@ -4366,7 +4367,7 @@ Commander::offboard_control_update(bool &status_changed)
|
|||
|
||||
}
|
||||
|
||||
void Commander::esc_status_check()
|
||||
void Commander::esc_status_check(const esc_status_s &esc_status)
|
||||
{
|
||||
char esc_fail_msg[50];
|
||||
esc_fail_msg[0] = '\0';
|
||||
|
|
|
@ -65,6 +65,7 @@
|
|||
#include <uORB/topics/vehicle_command.h>
|
||||
#include <uORB/topics/vehicle_global_position.h>
|
||||
#include <uORB/topics/vehicle_local_position.h>
|
||||
#include <uORB/topics/esc_status.h>
|
||||
|
||||
using math::constrain;
|
||||
|
||||
|
@ -217,7 +218,7 @@ private:
|
|||
|
||||
void battery_status_check();
|
||||
|
||||
void esc_status_check();
|
||||
void esc_status_check(const esc_status_s &esc_status);
|
||||
|
||||
/**
|
||||
* Checks the status of all available data links and handles switching between different system telemetry states.
|
||||
|
|
Loading…
Reference in New Issue