diff --git a/stm32-modules/include/flex-stacker/flex-stacker/motor_task.hpp b/stm32-modules/include/flex-stacker/flex-stacker/motor_task.hpp index 4f2cd95b..67cdaedb 100644 --- a/stm32-modules/include/flex-stacker/flex-stacker/motor_task.hpp +++ b/stm32-modules/include/flex-stacker/flex-stacker/motor_task.hpp @@ -96,10 +96,8 @@ class MotorTask { if (!engage.has_value()) { return true; } - if (engage.value()) { - return policy.enable_motor(id); - } - return policy.disable_motor(id); + return engage.value() ? policy.enable_motor(id) + : policy.disable_motor(id); } template