|
@@ -5703,10 +5703,36 @@ inline void gcode_M226() {
|
5703
|
5703
|
#if ENABLED(PREVENT_DANGEROUS_EXTRUDE)
|
5704
|
5704
|
|
5705
|
5705
|
/**
|
5706
|
|
- * M302: Allow cold extrudes, or set the minimum extrude S<temperature>.
|
|
5706
|
+ * M302: Allow cold extrudes, or set the minimum extrude temperature
|
|
5707
|
+ *
|
|
5708
|
+ * S<temperature> sets the minimum extrude temperature
|
|
5709
|
+ * P<bool> enables (1) or disables (0) cold extrusion
|
|
5710
|
+ *
|
|
5711
|
+ * Examples:
|
|
5712
|
+ *
|
|
5713
|
+ * M302 ; report current cold extrusion state
|
|
5714
|
+ * M302 P0 ; enable cold extrusion checking
|
|
5715
|
+ * M302 P1 ; disables cold extrusion checking
|
|
5716
|
+ * M302 S0 ; always allow extrusion (disables checking)
|
|
5717
|
+ * M302 S170 ; only allow extrusion above 170
|
|
5718
|
+ * M302 S170 P1 ; set min extrude temp to 170 but leave disabled
|
5707
|
5719
|
*/
|
5708
|
5720
|
inline void gcode_M302() {
|
5709
|
|
- thermalManager.extrude_min_temp = code_seen('S') ? code_value_temp_abs() : 0;
|
|
5721
|
+ bool seen_S = code_seen('S');
|
|
5722
|
+ if (seen_S) {
|
|
5723
|
+ thermalManager.extrude_min_temp = code_value_temp_abs();
|
|
5724
|
+ thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0);
|
|
5725
|
+ }
|
|
5726
|
+
|
|
5727
|
+ if (code_seen('P'))
|
|
5728
|
+ thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || code_value_bool();
|
|
5729
|
+ else if (!seen_S) {
|
|
5730
|
+ // Report current state
|
|
5731
|
+ SERIAL_ECHO_START;
|
|
5732
|
+ SERIAL_ECHOPAIR("Cold extrudes are ", (thermalManager.allow_cold_extrude ? "en" : "dis"));
|
|
5733
|
+ SERIAL_ECHOPAIR("abled (min temp ", int(thermalManager.extrude_min_temp + 0.5));
|
|
5734
|
+ SERIAL_ECHOLNPGM("C)");
|
|
5735
|
+ }
|
5710
|
5736
|
}
|
5711
|
5737
|
|
5712
|
5738
|
#endif // PREVENT_DANGEROUS_EXTRUDE
|