From 1c19158bbc38af88d3025bd4b2a5f5221191e3f4 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Mon, 9 Jun 2014 23:18:46 +0200 Subject: [PATCH] DDA: use new generic um_to_steps_* in dda_new_startpoint(). This was contributed by Phil Hord as part of another commit. It saves 168 bytes, to it more than outweights the overhead of introducing a generic implementation already. --- dda.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dda.c b/dda.c index 5d1bcef..26cfbbb 100644 --- a/dda.c +++ b/dda.c @@ -65,10 +65,10 @@ void dda_init(void) { This is needed for example after homing or a G92. The new location must be in startpoint already. */ void dda_new_startpoint(void) { - startpoint_steps.axis[X] = um_to_steps_x(startpoint.axis[X]); - startpoint_steps.axis[Y] = um_to_steps_y(startpoint.axis[Y]); - startpoint_steps.axis[Z] = um_to_steps_z(startpoint.axis[Z]); - startpoint_steps.axis[E] = um_to_steps_e(startpoint.axis[E]); + enum axis_e i; + + for (i = X; i < AXIS_COUNT; i++) + startpoint_steps.axis[i] = um_to_steps(startpoint.axis[i], i); } /*! CREATE a dda given current_position and a target, save to passed location so we can write directly into the queue