mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 09:43:34 +08:00
EscBattery: only publish data if all the ESCs are online
Signed-off-by: Claudio Micheli <claudio@auterion.com>
This commit is contained in:
committed by
Julian Oes
parent
c1884975ed
commit
4cdc58ce8d
@@ -80,7 +80,9 @@ EscBattery::Run()
|
||||
|
||||
if (_esc_status_sub.copy(&esc_status)) {
|
||||
|
||||
if (esc_status.esc_count == 0 ||
|
||||
int online_bitmask = (1 << esc_status.esc_count) - 1;
|
||||
|
||||
if (online_bitmask != esc_status.esc_online_flags || esc_status.esc_count == 0 ||
|
||||
esc_status.esc_count > esc_status_s::CONNECTED_ESC_MAX) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user