Browse Source

Move M301 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
609c4eea32
  1. 4
      Marlin/src/Marlin.cpp
  2. 11
      Marlin/src/gcode/config/M301.cpp
  3. 7
      Marlin/src/gcode/gcode.cpp

4
Marlin/src/Marlin.cpp

@ -352,10 +352,6 @@ bool pin_is_protected(const int8_t pin) {
return false; return false;
} }
#if ENABLED(PIDTEMP)
#include "gcode/config/M301.h"
#endif
#if ENABLED(PIDTEMPBED) #if ENABLED(PIDTEMPBED)
#include "gcode/config/M304.h" #include "gcode/config/M304.h"
#endif #endif

11
Marlin/src/gcode/config/M301.h → Marlin/src/gcode/config/M301.cpp

@ -20,6 +20,13 @@
* *
*/ */
#include "../../inc/MarlinConfig.h"
#if ENABLED(PIDTEMP)
#include "../gcode.h"
#include "../../module/temperature.h"
/** /**
* M301: Set PID parameters P I D (and optionally C, L) * M301: Set PID parameters P I D (and optionally C, L)
* *
@ -32,7 +39,7 @@
* C[float] Kc term * C[float] Kc term
* L[float] LPQ length * L[float] LPQ length
*/ */
void gcode_M301() { void GcodeSuite::M301() {
// multi-extruder PID patch: M301 updates or prints a single extruder's PID values // multi-extruder PID patch: M301 updates or prints a single extruder's PID values
// default behaviour (omitting E parameter) is to update for extruder 0 only // default behaviour (omitting E parameter) is to update for extruder 0 only
@ -67,3 +74,5 @@ void gcode_M301() {
SERIAL_ERRORLN(MSG_INVALID_EXTRUDER); SERIAL_ERRORLN(MSG_INVALID_EXTRUDER);
} }
} }
#endif // PIDTEMP

7
Marlin/src/gcode/gcode.cpp

@ -121,7 +121,6 @@ extern void gcode_M164();
extern void gcode_M165(); extern void gcode_M165();
extern void gcode_M240(); extern void gcode_M240();
extern void gcode_M250(); extern void gcode_M250();
extern void gcode_M301();
extern void gcode_M302(); extern void gcode_M302();
extern void gcode_M304(); extern void gcode_M304();
extern void gcode_M350(); extern void gcode_M350();
@ -570,10 +569,8 @@ void GcodeSuite::process_next_command() {
#endif #endif
#if ENABLED(PIDTEMP) #if ENABLED(PIDTEMP)
case 301: // M301: Set hotend PID parameters case 301: M301(); break; // M301: Set hotend PID parameters
gcode_M301(); #endif
break;
#endif // PIDTEMP
#if ENABLED(PIDTEMPBED) #if ENABLED(PIDTEMPBED)
case 304: // M304: Set bed PID parameters case 304: // M304: Set bed PID parameters

Loading…
Cancel
Save