Move M304 to cpp

This commit is contained in:
Scott Lahteine 2017-09-17 03:09:48 -05:00
parent 609c4eea32
commit d4aaa0f1c8
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; return false;
} }
#if ENABLED(PIDTEMPBED)
#include "gcode/config/M304.h"
#endif
#if defined(CHDK) || HAS_PHOTOGRAPH #if defined(CHDK) || HAS_PHOTOGRAPH
#include "gcode/feature/camera/M240.h" #include "gcode/feature/camera/M240.h"
#endif #endif

View File

@ -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('P')) thermalManager.bedKp = parser.value_float();
if (parser.seen('I')) thermalManager.bedKi = scalePID_i(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()); 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_ECHOPAIR(" i:", unscalePID_i(thermalManager.bedKi));
SERIAL_ECHOLNPAIR(" d:", unscalePID_d(thermalManager.bedKd)); SERIAL_ECHOLNPAIR(" d:", unscalePID_d(thermalManager.bedKd));
} }
#endif // PIDTEMPBED

View File

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