Browse Source

Move M43 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
be8d913484
  1. 4
      Marlin/src/Marlin.cpp
  2. 15
      Marlin/src/gcode/config/M43.cpp
  3. 5
      Marlin/src/gcode/gcode.cpp

4
Marlin/src/Marlin.cpp

@ -370,10 +370,6 @@ bool pin_is_protected(const int8_t pin) {
return false;
}
#if ENABLED(PINS_DEBUGGING)
#include "gcode/config/M43.h"
#endif
#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
#include "gcode/calibrate/M48.h"
#endif

15
Marlin/src/gcode/config/M43.h → Marlin/src/gcode/config/M43.cpp

@ -20,9 +20,18 @@
*
*/
#include "../gcode.h"
#include "../../inc/MarlinConfig.h"
#if ENABLED(PINS_DEBUGGING)
#include "../gcode.h"
#include "../../Marlin.h" // for pin_is_protected
#include "../../pins/pinsDebug.h"
#include "../../module/endstops.h"
#if HAS_Z_SERVO_ENDSTOP
#include "../../module/probe.h"
#endif
inline void toggle_pins() {
const bool I_flag = parser.boolval('I');
@ -227,7 +236,7 @@ inline void servo_probe_test() {
* M43 S - Servo probe test
* P<index> - Probe index (optional - defaults to 0
*/
void gcode_M43() {
void GcodeSuite::M43() {
if (parser.seen('T')) { // must be first or else its "S" and "E" parameters will execute endstop or servo test
toggle_pins();
@ -311,3 +320,5 @@ void gcode_M43() {
for (uint8_t pin = first_pin; pin <= last_pin; pin++)
if (VALID_PIN(pin)) report_pin_state_extended(pin, ignore_protection, true);
}
#endif // PINS_DEBUGGING

5
Marlin/src/gcode/gcode.cpp

@ -117,7 +117,6 @@ void GcodeSuite::dwell(millis_t time) {
// Placeholders for non-migrated codes
//
extern void gcode_M18_M84();
extern void gcode_M43();
extern void gcode_M48();
extern void gcode_M75();
extern void gcode_M76();
@ -435,11 +434,9 @@ void GcodeSuite::process_next_command() {
case 42: M42(); break; // M42: Change pin state
#if ENABLED(PINS_DEBUGGING)
case 43: // M43: Read pin state
gcode_M43(); break;
case 43: M43(); break; // M43: Read pin state
#endif
#if ENABLED(Z_MIN_PROBE_REPEATABILITY_TEST)
case 48: // M48: Z probe repeatability test
gcode_M48();

Loading…
Cancel
Save