|
@@ -719,24 +719,28 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
719
|
719
|
|
720
|
720
|
long de = target[E_AXIS] - position[E_AXIS];
|
721
|
721
|
|
|
722
|
+ const float e_factor = volumetric_multiplier[extruder] * flow_percentage[extruder] * 0.01;
|
|
723
|
+
|
722
|
724
|
#if ENABLED(LIN_ADVANCE)
|
723
|
725
|
float de_float = e - position_float[E_AXIS];
|
724
|
726
|
#endif
|
725
|
727
|
|
726
|
|
- #if ENABLED(PREVENT_COLD_EXTRUSION)
|
|
728
|
+ #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE)
|
727
|
729
|
if (de) {
|
728
|
|
- if (thermalManager.tooColdToExtrude(extruder)) {
|
729
|
|
- position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
|
730
|
|
- de = 0; // no difference
|
731
|
|
- #if ENABLED(LIN_ADVANCE)
|
732
|
|
- position_float[E_AXIS] = e;
|
733
|
|
- de_float = 0;
|
734
|
|
- #endif
|
735
|
|
- SERIAL_ECHO_START();
|
736
|
|
- SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
|
737
|
|
- }
|
|
730
|
+ #if ENABLED(PREVENT_COLD_EXTRUSION)
|
|
731
|
+ if (thermalManager.tooColdToExtrude(extruder)) {
|
|
732
|
+ position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
|
|
733
|
+ de = 0; // no difference
|
|
734
|
+ #if ENABLED(LIN_ADVANCE)
|
|
735
|
+ position_float[E_AXIS] = e;
|
|
736
|
+ de_float = 0;
|
|
737
|
+ #endif
|
|
738
|
+ SERIAL_ECHO_START();
|
|
739
|
+ SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
|
|
740
|
+ }
|
|
741
|
+ #endif // PREVENT_COLD_EXTRUSION
|
738
|
742
|
#if ENABLED(PREVENT_LENGTHY_EXTRUDE)
|
739
|
|
- int32_t de_mm = labs(de * volumetric_multiplier[active_extruder]);
|
|
743
|
+ const int32_t de_mm = labs(de * e_factor);
|
740
|
744
|
if (de_mm > (int32_t)axis_steps_per_mm[E_AXIS_N] * (EXTRUDE_MAXLENGTH)) { // It's not important to get max. extrusion length in a precision < 1mm, so save some cycles and cast to int
|
741
|
745
|
position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
|
742
|
746
|
de = 0; // no difference
|
|
@@ -747,9 +751,9 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
747
|
751
|
SERIAL_ECHO_START();
|
748
|
752
|
SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
|
749
|
753
|
}
|
750
|
|
- #endif
|
|
754
|
+ #endif // PREVENT_LENGTHY_EXTRUDE
|
751
|
755
|
}
|
752
|
|
- #endif
|
|
756
|
+ #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE
|
753
|
757
|
|
754
|
758
|
// Compute direction bit-mask for this block
|
755
|
759
|
uint8_t dm = 0;
|
|
@@ -778,7 +782,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
778
|
782
|
#endif
|
779
|
783
|
if (de < 0) SBI(dm, E_AXIS);
|
780
|
784
|
|
781
|
|
- const float esteps_float = de * volumetric_multiplier[extruder] * flow_percentage[extruder] * 0.01;
|
|
785
|
+ const float esteps_float = de * e_factor;
|
782
|
786
|
const int32_t esteps = abs(esteps_float) + 0.5;
|
783
|
787
|
|
784
|
788
|
// Calculate the buffer head after we push this byte
|