diff options
author | Emanuele Caruso <emanuele.caruso@gmail.com> | 2011-04-05 16:58:58 +0200 |
---|---|---|
committer | Emanuele Caruso <emanuele.caruso@gmail.com> | 2011-04-05 17:52:23 +0200 |
commit | 25d00d4147c5533eee9afde9b28e35e6b013c677 (patch) | |
tree | 3758ff368b58ed77ff517f48bef31ab7c4a856bd | |
parent | 2f151cff4b71c8e537de90bba4a262a70a516e71 (diff) |
Performance tweak: removed timediff calculations for extruder steps if the move has X or Y steps, since it is not used in that case
-rw-r--r-- | Tonokip_Firmware/Tonokip_Firmware.pde | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Tonokip_Firmware/Tonokip_Firmware.pde b/Tonokip_Firmware/Tonokip_Firmware.pde index f5941c7..e441121 100644 --- a/Tonokip_Firmware/Tonokip_Firmware.pde +++ b/Tonokip_Firmware/Tonokip_Firmware.pde @@ -378,7 +378,7 @@ inline void process_commands() if(x_steps_to_take) x_interval = time_for_move/x_steps_to_take; if(y_steps_to_take) y_interval = time_for_move/y_steps_to_take; if(z_steps_to_take) z_interval = time_for_move/z_steps_to_take; - if(e_steps_to_take) e_interval = time_for_move/e_steps_to_take; + if(e_steps_to_take && (x_steps_to_take + y_steps_to_take <= 0)) e_interval = time_for_move/e_steps_to_take; //#define DEBUGGING false #if 0 @@ -754,12 +754,12 @@ void linear_move(unsigned long x_steps_remaining, unsigned long y_steps_remainin } if(e_steps_remaining){ - timediff=micros()-previous_micros_e; + if (x_steps_to_take + y_steps_to_take <= 0) 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 / 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;} + if (final_e_steps_remaining > 0) while(e_steps_remaining > final_e_steps_remaining) { do_e_step(); e_steps_remaining--;} + else if (x_steps_to_take + y_steps_to_take > 0) while(e_steps_remaining) { do_e_step(); e_steps_remaining--;} else while (timediff >= e_interval && e_steps_remaining) { do_e_step(); e_steps_remaining--; timediff-=e_interval;} } if( (millis() - previous_millis_heater) >= 500 ) { |