diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 464b552dc5..826ad85ef2 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -352,10 +352,6 @@ bool pin_is_protected(const int8_t pin) { return false; } -#if defined(CHDK) || HAS_PHOTOGRAPH - #include "gcode/feature/camera/M240.h" -#endif - #if HAS_LCD_CONTRAST #include "gcode/lcd/M250.h" #endif diff --git a/Marlin/src/gcode/feature/camera/M240.h b/Marlin/src/gcode/feature/camera/M240.cpp similarity index 90% rename from Marlin/src/gcode/feature/camera/M240.h rename to Marlin/src/gcode/feature/camera/M240.cpp index 31210a3d66..9d729acf33 100644 --- a/Marlin/src/gcode/feature/camera/M240.h +++ b/Marlin/src/gcode/feature/camera/M240.cpp @@ -20,11 +20,17 @@ * */ +#include "../../../inc/MarlinConfig.h" + +#if defined(CHDK) || HAS_PHOTOGRAPH + +#include "../../gcode.h" + /** * M240: Trigger a camera by emulating a Canon RC-1 * See http://www.doc-diy.net/photo/rc-1_hacked/ */ -void gcode_M240() { +void GcodeSuite::M240() { #ifdef CHDK OUT_WRITE(CHDK, HIGH); @@ -51,3 +57,5 @@ void gcode_M240() { #endif } + +#endif // CHDK || HAS_PHOTOGRAPH diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 5f965ddb50..bb0b637c9a 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -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_M240(); extern void gcode_M250(); extern void gcode_M302(); extern void gcode_M350(); @@ -576,10 +575,8 @@ void GcodeSuite::process_next_command() { #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/ - gcode_M240(); - break; - #endif // CHDK || PHOTOGRAPH_PIN + case 240: M240(); break; // M240: Trigger a camera by emulating a Canon RC-1 : http://www.doc-diy.net/photo/rc-1_hacked/ + #endif #if HAS_LCD_CONTRAST case 250: // M250: Set LCD contrast