* M302: Allow cold extrudes, or set the minimum extrude temperature * * S sets the minimum extrude temperature * P enables (1) or disables (0) cold extrusion * * Examples: * * M302 ; report current cold extrusion state * M302 P0 ; enable cold extrusion checking * M302 P1 ; disable cold extrusion checking * M302 S0
| 48 | * M302 S170 P1 ; set min extrude temp to 170 but leave disabled |
| 49 | */ |
| 50 | void GcodeSuite::M302() { |
| 51 | const bool seen_S = parser.seen('S'); |
| 52 | if (seen_S) { |
| 53 | thermalManager.extrude_min_temp = parser.value_celsius(); |
| 54 | TERN_(EXTENSIBLE_UI, ExtUI::onSetMinExtrusionTemp(thermalManager.extrude_min_temp)); |
| 55 | } |
| 56 | |
| 57 | const bool seen_P = parser.seen('P'); |
| 58 | if (seen_P || seen_S) { |
| 59 | thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || (seen_P && parser.value_bool()); |
| 60 | } |
| 61 | else { |
| 62 | // Report current state |
| 63 | SERIAL_ECHO_START(); |
| 64 | SERIAL_ECHOLN(F("Cold extrudes are "), thermalManager.allow_cold_extrude ? F("en") : F("dis"), F("abled (min temp "), thermalManager.extrude_min_temp, F("C)")); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | #endif // PREVENT_COLD_EXTRUSION |
nothing calls this directly
no test coverage detected