From f0de88fada856a28a48d1e8f561739bc24fad457 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Mon, 21 Jun 2021 21:01:02 +0200 Subject: [PATCH] vtol_type: fix motor_state::VALUE Signed-off-by: Silvan Fuhrer --- src/modules/vtol_att_control/vtol_type.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/vtol_att_control/vtol_type.cpp b/src/modules/vtol_att_control/vtol_type.cpp index f4570da9d7..a913ac2b0b 100644 --- a/src/modules/vtol_att_control/vtol_type.cpp +++ b/src/modules/vtol_att_control/vtol_type.cpp @@ -381,7 +381,7 @@ void VtolType::set_all_motor_state(const motor_state target_state, const int val void VtolType::set_main_motor_state(const motor_state target_state, const int value) { - if (_main_motor_state != target_state) { + if (_main_motor_state != target_state || target_state == motor_state::VALUE) { if (set_motor_state(target_state, _main_motor_channel_bitmap, value)) { _main_motor_state = target_state; @@ -391,7 +391,7 @@ void VtolType::set_main_motor_state(const motor_state target_state, const int va void VtolType::set_alternate_motor_state(const motor_state target_state, const int value) { - if (_alternate_motor_state != target_state) { + if (_alternate_motor_state != target_state || target_state == motor_state::VALUE) { if (set_motor_state(target_state, _alternate_motor_channel_bitmap, value)) { _alternate_motor_state = target_state;