mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-10 08:17:52 -06:00
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>
This commit is contained in:
parent
fa85094cbb
commit
b0524947e5
7 changed files with 14 additions and 14 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue