diff options
author | Emanuele Caruso <emanuele.caruso@gmail.com> | 2011-04-05 00:48:48 +0200 |
---|---|---|
committer | Emanuele Caruso <emanuele.caruso@gmail.com> | 2011-04-05 00:48:48 +0200 |
commit | 698e33c12d5346a6de1d4ff404d0f47b0554ca87 (patch) | |
tree | d4e29c033f6e07bd295ddcbe8fe7b7f88dae2fcb /Tonokip_Firmware | |
parent | dc53111a7100216da47dd85a7388998c606bdf90 (diff) |
Removed float calculations in the new extruder move algorithm
Diffstat (limited to 'Tonokip_Firmware')
-rw-r--r-- | Tonokip_Firmware/Tonokip_Firmware.pde | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Tonokip_Firmware/Tonokip_Firmware.pde b/Tonokip_Firmware/Tonokip_Firmware.pde index 0a0cfed..c233fc4 100644 --- a/Tonokip_Firmware/Tonokip_Firmware.pde +++ b/Tonokip_Firmware/Tonokip_Firmware.pde @@ -873,8 +873,8 @@ void linear_move(unsigned long x_steps_remaining, unsigned long y_steps_remainin if(e_steps_remaining){ timediff=micros()-previous_micros_e; unsigned int final_e_steps_remaining = 0; - if (steep_x && x_steps_to_take > 0) final_e_steps_remaining = e_steps_to_take * (x_steps_remaining) / ((float) x_steps_to_take); - else if (steep_y && y_steps_to_take > 0) final_e_steps_remaining = e_steps_to_take * (y_steps_remaining) / ((float) y_steps_to_take); + if (steep_x && x_steps_to_take > 0) final_e_steps_remaining = e_steps_to_take * x_steps_remaining / x_steps_to_take; + else if (steep_y && y_steps_to_take > 0) final_e_steps_remaining = e_steps_to_take * y_steps_remaining / y_steps_to_take; if (final_e_steps_remaining > 0) while(e_steps_remaining > final_e_steps_remaining) { do_e_step(); e_steps_remaining--; timediff-=e_interval;} else if (x_steps_to_take > 0 || y_steps_to_take > 0) while(e_steps_remaining) { do_e_step(); e_steps_remaining--; timediff-=e_interval;} else while (timediff >= e_interval && e_steps_remaining) { do_e_step(); e_steps_remaining--; timediff-=e_interval;} |