From ebb9bd541919c9682e9550aab5dc6052e3ebb729 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Sep 2017 03:20:32 -0500 Subject: [PATCH] Move M240 to cpp --- Marlin/src/Marlin.cpp | 4 ---- Marlin/src/gcode/feature/camera/{M240.h => M240.cpp} | 10 +++++++++- Marlin/src/gcode/gcode.cpp | 7 ++----- 3 files changed, 11 insertions(+), 10 deletions(-) rename Marlin/src/gcode/feature/camera/{M240.h => M240.cpp} (90%) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 464b552dc..826ad85ef 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 31210a3d6..9d729acf3 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 5f965ddb5..bb0b637c9 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