diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-06-08 21:33:50 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-06-14 14:00:53 -0400 |
commit | b0524947e5a86bdbdd58dab42de3363a627e6910 (patch) | |
tree | 1187da49413ab45f0133372ce2778e19a34097c4 /src/stepper.c | |
parent | fa85094cbb139c734150802b02e22913abcfccb3 (diff) | |
download | kutter-b0524947e5a86bdbdd58dab42de3363a627e6910.tar.gz kutter-b0524947e5a86bdbdd58dab42de3363a627e6910.tar.xz kutter-b0524947e5a86bdbdd58dab42de3363a627e6910.zip |
sched: Use uint_fast8_t for return type of timers
Some architectures are faster passing regular integers than 8bit
integers. Use uint_fast8_t so that the architecture chooses the
appropriate type.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stepper.c')
-rw-r--r-- | src/stepper.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stepper.c b/src/stepper.c index 0d4754f9..5b5203f1 100644 --- a/src/stepper.c +++ b/src/stepper.c @@ -35,7 +35,7 @@ enum { MF_DIR=1 }; enum { SF_LAST_DIR=1, SF_NEXT_DIR=2, SF_INVERT_STEP=4, SF_HAVE_ADD=8 }; // Setup a stepper for the next move in its queue -static uint8_t +static uint_fast8_t stepper_load_next(struct stepper *s) { struct move *m = s->first; @@ -64,7 +64,7 @@ stepper_load_next(struct stepper *s) } // Timer callback - step the given stepper. -uint8_t +uint_fast8_t stepper_event(struct timer *t) { struct stepper *s = container_of(t, struct stepper, time); @@ -78,7 +78,7 @@ stepper_event(struct timer *t) s->interval += s->add; return SF_RESCHEDULE; } - uint8_t ret = stepper_load_next(s); + uint_fast8_t ret = stepper_load_next(s); gpio_out_toggle(s->step_pin); return ret; } |