diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-05-11 14:01:06 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-05-15 14:02:59 -0400 |
commit | 039d3f05239e48f0ddfae5fb14cde00d817b9ed2 (patch) | |
tree | 2723bc1aabe23f7da7bd134bf3157961716800cc /src | |
parent | d56f8407a589919d913941d78a7ff7305ae41766 (diff) | |
download | kutter-039d3f05239e48f0ddfae5fb14cde00d817b9ed2.tar.gz kutter-039d3f05239e48f0ddfae5fb14cde00d817b9ed2.tar.xz kutter-039d3f05239e48f0ddfae5fb14cde00d817b9ed2.zip |
stepper: It is not necessary to ensure gpio_out_write value is 0 or 1
The gpio_out_write() and gpio_out_setup() calls will check for zero
and non-zero, so it is not necessary to explicitly convert to 0/1 in
the stepper.c code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/stepper.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stepper.c b/src/stepper.c index 749d470e..258ecfda 100644 --- a/src/stepper.c +++ b/src/stepper.c @@ -150,7 +150,7 @@ command_config_stepper(uint32_t *args) if (!CONFIG_INLINE_STEPPER_HACK) s->time.func = stepper_event; s->flags = args[4] ? SF_INVERT_STEP : 0; - s->step_pin = gpio_out_setup(args[1], s->flags & SF_INVERT_STEP ? 1 : 0); + s->step_pin = gpio_out_setup(args[1], s->flags & SF_INVERT_STEP); s->dir_pin = gpio_out_setup(args[2], 0); s->min_stop_interval = args[3]; s->position = -POSITION_BIAS; @@ -276,7 +276,7 @@ stepper_stop(struct stepper *s) s->count = 0; s->flags &= SF_INVERT_STEP; gpio_out_write(s->dir_pin, 0); - gpio_out_write(s->step_pin, s->flags & SF_INVERT_STEP ? 1 : 0); + gpio_out_write(s->step_pin, s->flags & SF_INVERT_STEP); while (s->first) { struct stepper_move *next = s->first->next; move_free(s->first); |