From 0a45614751eb1ef071c7f105dcd705cab4388f77 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Thu, 9 Jan 2025 11:30:04 +0300 Subject: [PATCH] Move `motorsActive` function to motors.ino --- flix/control.ino | 4 ---- flix/motors.ino | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flix/control.ino b/flix/control.ino index 0eb03d8..4633043 100644 --- a/flix/control.ino +++ b/flix/control.ino @@ -164,10 +164,6 @@ void controlTorque() { motors[3] = constrain(motors[3], 0, 1); } -bool motorsActive() { - return motors[0] > 0 || motors[1] > 0 || motors[2] > 0 || motors[3] > 0; -} - const char* getModeName() { switch (mode) { case MANUAL: return "MANUAL"; diff --git a/flix/motors.ino b/flix/motors.ino index 5e15506..1a7e786 100644 --- a/flix/motors.ino +++ b/flix/motors.ino @@ -46,3 +46,7 @@ void sendMotors() { ledcWrite(MOTOR_2_PIN, getDutyCycle(motors[2])); ledcWrite(MOTOR_3_PIN, getDutyCycle(motors[3])); } + +bool motorsActive() { + return motors[0] != 0 || motors[1] != 0 || motors[2] != 0 || motors[3] != 0; +}