Move M302 to cpp

This commit is contained in:
Scott Lahteine 2017-09-17 03:29:29 -05:00
parent 8584f7e390
commit 828405cac8
3 changed files with 12 additions and 10 deletions

View file

@ -352,10 +352,6 @@ bool pin_is_protected(const int8_t pin) {
return false;
}
#if ENABLED(PREVENT_COLD_EXTRUSION)
#include "gcode/config/M302.h"
#endif
#if ENABLED(MORGAN_SCARA)
#include "gcode/scara/M360-M364.h"
#endif

View file

@ -20,6 +20,13 @@
*
*/
#include "../../inc/MarlinConfig.h"
#if ENABLED(PREVENT_COLD_EXTRUSION)
#include "../gcode.h"
#include "../../module/temperature.h"
/**
* M302: Allow cold extrudes, or set the minimum extrude temperature
*
@ -35,7 +42,7 @@
* M302 S170 ; only allow extrusion above 170
* M302 S170 P1 ; set min extrude temp to 170 but leave disabled
*/
void gcode_M302() {
void GcodeSuite::M302() {
const bool seen_S = parser.seen('S');
if (seen_S) {
thermalManager.extrude_min_temp = parser.value_celsius();
@ -52,3 +59,5 @@ void gcode_M302() {
SERIAL_ECHOLNPGM("C)");
}
}
#endif // PREVENT_COLD_EXTRUSION

View file

@ -119,7 +119,6 @@ void GcodeSuite::dwell(millis_t time) {
extern void gcode_M163();
extern void gcode_M164();
extern void gcode_M165();
extern void gcode_M302();
extern void gcode_M350();
extern void gcode_M351();
extern void gcode_M355();
@ -587,10 +586,8 @@ void GcodeSuite::process_next_command() {
#endif
#if ENABLED(PREVENT_COLD_EXTRUSION)
case 302: // M302: Allow cold extrudes (set the minimum extrude temperature)
gcode_M302();
break;
#endif // PREVENT_COLD_EXTRUSION
case 302: M302(); break; // M302: Allow cold extrudes (set the minimum extrude temperature)
#endif
case 303: // M303: PID autotune
M303();