Skip to content

Commit

Permalink
pbio/control: clear extra control flags on stop
Browse files Browse the repository at this point in the history
Upon triggering coast or brake, call the generic control stopper instead of setting the type to none directly. This way the stall flag gets cleared as well.
  • Loading branch information
laurensvalk committed Apr 20, 2020
1 parent 0f03812 commit f727c1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pbio/src/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void control_update(pbio_control_t *ctl, int32_t time_now, int32_t count_now, in
if (ctl->on_target && ctl->after_stop != PBIO_ACTUATION_HOLD) {
*actuation_type = ctl->after_stop;
*control = 0;
ctl->type = PBIO_CONTROL_NONE;
pbio_control_stop(ctl);
}
else if (ctl->on_target && ctl->after_stop == PBIO_ACTUATION_HOLD && ctl->type == PBIO_CONTROL_TIMED) {
// If we are going to hold and we are already doing angle control, there is nothing we need to do.
Expand Down

0 comments on commit f727c1a

Please sign in to comment.