Browse Source

Move M119-M121 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
eef4a54778
  1. 4
      Marlin/src/Marlin.cpp
  2. 15
      Marlin/src/gcode/control/M120_M121.cpp
  3. 15
      Marlin/src/gcode/gcode.cpp
  4. 9
      Marlin/src/gcode/host/M119.cpp

4
Marlin/src/Marlin.cpp

@ -355,10 +355,6 @@ bool pin_is_protected(const int8_t pin) {
return false;
}
#include "gcode/host/M119.h"
#include "gcode/control/M120_M121.h"
#if HAS_COLOR_LEDS
#include "gcode/feature/leds/M150.h"
#endif

15
Marlin/src/gcode/control/M120_M121.h → Marlin/src/gcode/control/M120_M121.cpp

@ -20,20 +20,15 @@
*
*/
#include "../gcode.h"
#include "../../module/endstops.h"
/**
* M120: Enable endstops and set non-homing endstop state to "enabled"
*/
void gcode_M120() {
endstops.enable_globally(true);
}
void GcodeSuite::M120() { endstops.enable_globally(true); }
/**
* M121: Disable endstops and set non-homing endstop state to "disabled"
*/
void gcode_M121() {
endstops.enable_globally(false);
}
void GcodeSuite::M121() { endstops.enable_globally(false); }

15
Marlin/src/gcode/gcode.cpp

@ -116,9 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
//
// Placeholders for non-migrated codes
//
extern void gcode_M119();
extern void gcode_M120();
extern void gcode_M121();
extern void gcode_M150();
extern void gcode_M163();
extern void gcode_M164();
@ -499,15 +496,9 @@ void GcodeSuite::process_next_command() {
case 117: M117(); break; // M117: Set LCD message text, if possible
case 118: M118(); break; // M118: Display a message in the host console
case 119: // M119: Report endstop states
gcode_M119();
break;
case 120: // M120: Enable endstops
gcode_M120();
break;
case 121: // M121: Disable endstops
gcode_M121();
break;
case 119: M119(); break; // M119: Report endstop states
case 120: M120(); break; // M120: Enable endstops
case 121: M121(); break; // M121: Disable endstops
#if ENABLED(ULTIPANEL)
case 145: M145(); break; // M145: Set material heatup parameters

9
Marlin/src/gcode/host/M119.h → Marlin/src/gcode/host/M119.cpp

@ -20,7 +20,14 @@
*
*/
#include "../gcode.h"
#include "../../module/endstops.h"
/**
* M119: Output endstop states to serial output
*/
void gcode_M119() { endstops.M119(); }
void GcodeSuite::M119() {
endstops.M119();
}
Loading…
Cancel
Save