drivecontroller: update status vector in prepare

pull/1/head
EmaMaker 2022-06-28 10:36:54 +02:00
parent c8997bfc73
commit d20d44c25e
1 changed files with 4 additions and 3 deletions

View File

@ -50,6 +50,10 @@ void DriveController::prepareDrive(int dir, int speed, int tilt){
pDir = dir; pDir = dir;
pSpeed = speed; pSpeed = speed;
pTilt = tilt; pTilt = tilt;
CURRENT_DATA_WRITE.dir = dir;
CURRENT_DATA_WRITE.speed = speed;
CURRENT_DATA_WRITE.tilt = tilt;
} }
void DriveController::drivePrepared(){ void DriveController::drivePrepared(){
@ -145,9 +149,6 @@ void DriveController::drive(int dir, int speed, int tilt){
oldSpeed = speed; 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[0] = vxp;
CURRENT_DATA_WRITE.axisBlock[1] = vxn; CURRENT_DATA_WRITE.axisBlock[1] = vxn;
CURRENT_DATA_WRITE.axisBlock[2] = vyp; CURRENT_DATA_WRITE.axisBlock[2] = vyp;