Browse Source

Move M304 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
d4aaa0f1c8
  1. 4
      Marlin/src/Marlin.cpp
  2. 11
      Marlin/src/gcode/config/M304.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;
}
#if ENABLED(PIDTEMPBED)
#include "gcode/config/M304.h"
#endif
#if defined(CHDK) || HAS_PHOTOGRAPH
#include "gcode/feature/camera/M240.h"
#endif

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

@ -20,7 +20,14 @@
*
*/
void gcode_M304() {
#include "../../inc/MarlinConfig.h"
#if ENABLED(PIDTEMPBED)
#include "../gcode.h"
#include "../../module/temperature.h"
void GcodeSuite::M304() {
if (parser.seen('P')) thermalManager.bedKp = parser.value_float();
if (parser.seen('I')) thermalManager.bedKi = scalePID_i(parser.value_float());
if (parser.seen('D')) thermalManager.bedKd = scalePID_d(parser.value_float());
@ -32,3 +39,5 @@ void gcode_M304() {
SERIAL_ECHOPAIR(" i:", unscalePID_i(thermalManager.bedKi));
SERIAL_ECHOLNPAIR(" d:", unscalePID_d(thermalManager.bedKd));
}
#endif // PIDTEMPBED

7
Marlin/src/gcode/gcode.cpp

@ -122,7 +122,6 @@ extern void gcode_M165();
extern void gcode_M240();
extern void gcode_M250();
extern void gcode_M302();
extern void gcode_M304();
extern void gcode_M350();
extern void gcode_M351();
extern void gcode_M355();
@ -573,10 +572,8 @@ void GcodeSuite::process_next_command() {
#endif
#if ENABLED(PIDTEMPBED)
case 304: // M304: Set bed PID parameters
gcode_M304();
break;
#endif // PIDTEMPBED
case 304: M304(); break; // M304: Set bed PID parameters
#endif
#if defined(CHDK) || HAS_PHOTOGRAPH
case 240: // M240: Trigger a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/

Loading…
Cancel
Save