From 5ad9b43c81cd7d9014193a4e7d14a539cc0c96d4 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+Tropix126@users.noreply.github.com> Date: Fri, 8 Mar 2024 11:55:07 -0600 Subject: [PATCH] refactor: rename `rotate_to_position` to `set_position_target` --- packages/pros-devices/src/smart/motor.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/pros-devices/src/smart/motor.rs b/packages/pros-devices/src/smart/motor.rs index 44163487..42017167 100644 --- a/packages/pros-devices/src/smart/motor.rs +++ b/packages/pros-devices/src/smart/motor.rs @@ -105,10 +105,6 @@ impl Motor { bail_on!(PROS_ERR, pros_sys::motor_brake(self.port.index() as i8)); }, MotorControl::Velocity(rpm) => unsafe { - bail_on!( - PROS_ERR, - pros_sys::motor_move_velocity(self.port.index() as i8, rpm) - ); bail_on!( PROS_ERR, pros_sys::motor_set_brake_mode( @@ -116,6 +112,10 @@ impl Motor { pros_sys::E_MOTOR_BRAKE_COAST ) ); + bail_on!( + PROS_ERR, + pros_sys::motor_move_velocity(self.port.index() as i8, rpm) + ); }, MotorControl::Voltage(volts) => { bail_on!(PROS_ERR, unsafe { @@ -168,7 +168,7 @@ impl Motor { } /// Sets an absolute position target for the motor to attempt to reach. - pub fn rotate_to_position( + pub fn set_position_target( &mut self, position: Position, velocity: i32,