From d20d44c25e303e0fdc3b3c94da5520bab89e8155 Mon Sep 17 00:00:00 2001 From: EmaMaker Date: Tue, 28 Jun 2022 10:36:54 +0200 Subject: [PATCH] drivecontroller: update status vector in prepare --- src/motors_movement/drivecontroller.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/motors_movement/drivecontroller.cpp b/src/motors_movement/drivecontroller.cpp index 0a1c9b5..102f3a1 100644 --- a/src/motors_movement/drivecontroller.cpp +++ b/src/motors_movement/drivecontroller.cpp @@ -50,6 +50,10 @@ void DriveController::prepareDrive(int dir, int speed, int tilt){ pDir = dir; pSpeed = speed; pTilt = tilt; + + CURRENT_DATA_WRITE.dir = dir; + CURRENT_DATA_WRITE.speed = speed; + CURRENT_DATA_WRITE.tilt = tilt; } void DriveController::drivePrepared(){ @@ -145,9 +149,6 @@ void DriveController::drive(int dir, int speed, int tilt){ oldSpeed = speed; } - CURRENT_DATA_WRITE.dir = dir; - CURRENT_DATA_WRITE.speed = speed; - CURRENT_DATA_WRITE.tilt = tilt; CURRENT_DATA_WRITE.axisBlock[0] = vxp; CURRENT_DATA_WRITE.axisBlock[1] = vxn; CURRENT_DATA_WRITE.axisBlock[2] = vyp;