Skip to content

Commit

Permalink
Fixed a small error in our motor driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
virtualabs committed Sep 3, 2024
1 parent 2f0a647 commit 89e87e3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cutcutgo.X/src/hal/motor.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,15 +624,21 @@ int hal_motor_step(hal_motor_driver_t *motor, int steps, hal_motor_direction_t d
break;

case HAL_MOTOR_DIR_CW:
{
{
offset = motor->rel_pos_th - motor->rel_pos;
}
break;

default:
break;
}


/* Do not exceed an extra step. */
if (offset > 8)
{
offset = 8;
}

motor->command_steps = 8 + offset;
motor->current_steps = 0;
motor->error_steps = 0;
Expand Down

0 comments on commit 89e87e3

Please sign in to comment.