|
@@ -662,7 +662,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
662
|
662
|
SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
|
663
|
663
|
}
|
664
|
664
|
#if ENABLED(PREVENT_LENGTHY_EXTRUDE)
|
665
|
|
- if (labs(de) > axis_steps_per_mm[E_AXIS] * (EXTRUDE_MAXLENGTH)) {
|
|
665
|
+ if (labs(de) > (int32_t)axis_steps_per_mm[E_AXIS] * (EXTRUDE_MAXLENGTH)) { // It's not important to get max. extrusion length in a precision < 1mm, so save some cycles and cast to int
|
666
|
666
|
position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
|
667
|
667
|
de = 0; // no difference
|
668
|
668
|
SERIAL_ECHO_START;
|
|
@@ -699,10 +699,11 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
699
|
699
|
#endif
|
700
|
700
|
if (de < 0) SBI(dm, E_AXIS);
|
701
|
701
|
|
702
|
|
- int32_t esteps = labs(de) * volumetric_multiplier[extruder] * flow_percentage[extruder] * 0.01 + 0.5;
|
|
702
|
+ float esteps_float = de * volumetric_multiplier[extruder] * flow_percentage[extruder] * 0.01;
|
|
703
|
+ int32_t esteps = abs(esteps_float) + 0.5;
|
703
|
704
|
|
704
|
705
|
// Calculate the buffer head after we push this byte
|
705
|
|
- int next_buffer_head = next_block_index(block_buffer_head);
|
|
706
|
+ int8_t next_buffer_head = next_block_index(block_buffer_head);
|
706
|
707
|
|
707
|
708
|
// If the buffer is full: good! That means we are well ahead of the robot.
|
708
|
709
|
// Rest here until there is room in the buffer.
|
|
@@ -798,7 +799,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
798
|
799
|
|
799
|
800
|
#if ENABLED(DISABLE_INACTIVE_EXTRUDER) // Enable only the selected extruder
|
800
|
801
|
|
801
|
|
- for (int i = 0; i < EXTRUDERS; i++)
|
|
802
|
+ for (int8_t i = 0; i < EXTRUDERS; i++)
|
802
|
803
|
if (g_uc_extruder_last_move[i] > 0) g_uc_extruder_last_move[i]--;
|
803
|
804
|
|
804
|
805
|
switch(extruder) {
|
|
@@ -903,7 +904,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
903
|
904
|
delta_mm[Y_AXIS] = db * steps_to_mm[Y_AXIS];
|
904
|
905
|
delta_mm[Z_AXIS] = dc * steps_to_mm[Z_AXIS];
|
905
|
906
|
#endif
|
906
|
|
- delta_mm[E_AXIS] = 0.01 * (de * steps_to_mm[E_AXIS]) * volumetric_multiplier[extruder] * flow_percentage[extruder];
|
|
907
|
+ delta_mm[E_AXIS] = esteps_float * steps_to_mm[E_AXIS];
|
907
|
908
|
|
908
|
909
|
if (block->steps[X_AXIS] < MIN_STEPS_PER_SEGMENT && block->steps[Y_AXIS] < MIN_STEPS_PER_SEGMENT && block->steps[Z_AXIS] < MIN_STEPS_PER_SEGMENT) {
|
909
|
910
|
block->millimeters = fabs(delta_mm[E_AXIS]);
|