Skip to content

Commit baada48

Browse files
committed
pbio/servo: Revert swapped dcmotor and tacho init.
This caused powered sensors to be reset and not turned back on after a program completed. It would be better to review this logic for the next release instead of breaking the release candidate. This reverts commit f128560.
1 parent a463250 commit baada48

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/pbio/src/servo.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ pbio_error_t pbio_servo_setup(pbio_servo_t *srv, pbio_direction_t direction, fix
3838
return PBIO_ERROR_BUSY;
3939
}
4040

41-
// Get, coast, and configure dc motor
42-
err = pbio_dcmotor_get(srv->port, &srv->dcmotor, direction, true);
41+
// Get and reset tacho
42+
err = pbio_tacho_get(srv->port, &srv->tacho, direction, gear_ratio);
4343
if (err != PBIO_SUCCESS) {
4444
return err;
4545
}
4646

47-
// Get and reset tacho
48-
err = pbio_tacho_get(srv->port, &srv->tacho, direction, gear_ratio);
47+
// Get, coast, and configure dc motor
48+
err = pbio_dcmotor_get(srv->port, &srv->dcmotor, direction, true);
4949
if (err != PBIO_SUCCESS) {
5050
return err;
5151
}

0 commit comments

Comments
 (0)