Browse Source

Move G20_G21 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
a1ee1628e5
  1. 4
      Marlin/src/Marlin.cpp
  2. 6
      Marlin/src/gcode/gcode.cpp
  3. 12
      Marlin/src/gcode/units/G20_G21.cpp

4
Marlin/src/Marlin.cpp

@ -357,10 +357,6 @@ void suicide() {
***************** GCode Handlers ***************** ***************** GCode Handlers *****************
**************************************************/ **************************************************/
#if ENABLED(INCH_MODE_SUPPORT)
#include "gcode/units/G20_G21.h"
#endif
#if ENABLED(NOZZLE_PARK_FEATURE) #if ENABLED(NOZZLE_PARK_FEATURE)
#include "gcode/feature/pause/G27.h" #include "gcode/feature/pause/G27.h"
#endif #endif

6
Marlin/src/gcode/gcode.cpp

@ -116,8 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
// //
// Placeholders for non-migrated codes // Placeholders for non-migrated codes
// //
extern void gcode_G20();
extern void gcode_G21();
extern void gcode_G27(); extern void gcode_G27();
extern void gcode_G30(); extern void gcode_G30();
extern void gcode_G31(); extern void gcode_G31();
@ -331,11 +329,11 @@ void GcodeSuite::process_next_command() {
#if ENABLED(INCH_MODE_SUPPORT) #if ENABLED(INCH_MODE_SUPPORT)
case 20: // G20: Inch Mode case 20: // G20: Inch Mode
gcode_G20(); G20();
break; break;
case 21: // G21: MM Mode case 21: // G21: MM Mode
gcode_G21(); G21();
break; break;
#endif // INCH_MODE_SUPPORT #endif // INCH_MODE_SUPPORT

12
Marlin/src/gcode/units/G20_G21.h → Marlin/src/gcode/units/G20_G21.cpp

@ -20,12 +20,20 @@
* *
*/ */
#include "../../inc/MarlinConfig.h"
#if ENABLED(INCH_MODE_SUPPORT)
#include "../gcode.h"
/** /**
* G20: Set input mode to inches * G20: Set input mode to inches
*/ */
void gcode_G20() { parser.set_input_linear_units(LINEARUNIT_INCH); } void GcodeSuite::G20() { parser.set_input_linear_units(LINEARUNIT_INCH); }
/** /**
* G21: Set input mode to millimeters * G21: Set input mode to millimeters
*/ */
void gcode_G21() { parser.set_input_linear_units(LINEARUNIT_MM); } void GcodeSuite::G21() { parser.set_input_linear_units(LINEARUNIT_MM); }
#endif // INCH_MODE_SUPPORT
Loading…
Cancel
Save