dda.c: make update_position() work with an empty queue.
This commit is contained in:
parent
7a458486ed
commit
2f8a257a0d
11
dda.c
11
dda.c
|
|
@ -682,9 +682,13 @@ void dda_step(DDA *dda) {
|
||||||
void update_current_position() {
|
void update_current_position() {
|
||||||
DDA *dda = &movebuffer[mb_tail];
|
DDA *dda = &movebuffer[mb_tail];
|
||||||
|
|
||||||
if (dda->live == 0)
|
if (queue_empty()) {
|
||||||
return;
|
current_position.X = startpoint.X;
|
||||||
|
current_position.Y = startpoint.Y;
|
||||||
|
current_position.Z = startpoint.Z;
|
||||||
|
current_position.E = startpoint.E;
|
||||||
|
}
|
||||||
|
else if (dda->live) {
|
||||||
if (dda->x_direction)
|
if (dda->x_direction)
|
||||||
current_position.X = dda->endpoint.X - move_state.x_steps;
|
current_position.X = dda->endpoint.X - move_state.x_steps;
|
||||||
else
|
else
|
||||||
|
|
@ -711,3 +715,4 @@ void update_current_position() {
|
||||||
|
|
||||||
// current_position.F is updated in dda_start()
|
// current_position.F is updated in dda_start()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue