mirror of https://github.com/Desuuuu/klipper.git
stepper: Fix bug when using a non-zero CONFIG_STEP_DELAY on AVR
Make sure to explicitly cast to 32bit integers when doing math on 16bit integers that require the extra precision as the AVR uses a 16bit int. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
32632c8226
commit
8a6125c81c
|
@ -86,7 +86,7 @@ stepper_load_next(struct stepper *s, uint32_t min_next_time)
|
|||
} else {
|
||||
s->time.waketime = s->next_step_time;
|
||||
}
|
||||
s->count = m->count * 2;
|
||||
s->count = (uint32_t)m->count * 2;
|
||||
}
|
||||
if (m->flags & MF_DIR) {
|
||||
s->position = -s->position + m->count;
|
||||
|
|
Loading…
Reference in New Issue