From b0524947e5a86bdbdd58dab42de3363a627e6910 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 8 Jun 2016 21:33:50 -0400 Subject: 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 --- src/stepper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/stepper.c') 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; } -- cgit v1.2.3-70-g09d2