Browse Source

Move M203-M205 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
7aca9fe2f7
  1. 4
      Marlin/src/Marlin.cpp
  2. 5
      Marlin/src/gcode/config/M203.cpp
  3. 5
      Marlin/src/gcode/config/M204.cpp
  4. 5
      Marlin/src/gcode/config/M205.cpp
  5. 15
      Marlin/src/gcode/gcode.cpp

4
Marlin/src/Marlin.cpp

@ -355,10 +355,6 @@ bool pin_is_protected(const int8_t pin) {
return false;
}
#include "gcode/config/M203.h"
#include "gcode/config/M204.h"
#include "gcode/config/M205.h"
#if HAS_M206_COMMAND
#include "gcode/geometry/M206.h"
#endif

5
Marlin/src/gcode/config/M203.h → Marlin/src/gcode/config/M203.cpp

@ -20,12 +20,15 @@
*
*/
#include "../gcode.h"
#include "../../module/planner.h"
/**
* M203: Set maximum feedrate that your machine can sustain (M203 X200 Y200 Z300 E10000) in units/sec
*
* With multiple extruders use T to specify which one.
*/
void gcode_M203() {
void GcodeSuite::M203() {
GET_TARGET_EXTRUDER();

5
Marlin/src/gcode/config/M204.h → Marlin/src/gcode/config/M204.cpp

@ -20,6 +20,9 @@
*
*/
#include "../gcode.h"
#include "../../module/planner.h"
/**
* M204: Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000)
*
@ -29,7 +32,7 @@
*
* Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate
*/
void gcode_M204() {
void GcodeSuite::M204() {
if (parser.seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments.
planner.travel_acceleration = planner.acceleration = parser.value_linear_units();
SERIAL_ECHOLNPAIR("Setting Print and Travel Acceleration: ", planner.acceleration);

5
Marlin/src/gcode/config/M205.h → Marlin/src/gcode/config/M205.cpp

@ -20,6 +20,9 @@
*
*/
#include "../gcode.h"
#include "../../module/planner.h"
/**
* M205: Set Advanced Settings
*
@ -31,7 +34,7 @@
* Z = Max Z Jerk (units/sec^2)
* E = Max E Jerk (units/sec^2)
*/
void gcode_M205() {
void GcodeSuite::M205() {
if (parser.seen('S')) planner.min_feedrate_mm_s = parser.value_linear_units();
if (parser.seen('T')) planner.min_travel_feedrate_mm_s = parser.value_linear_units();
if (parser.seen('B')) planner.min_segment_time = parser.value_millis();

15
Marlin/src/gcode/gcode.cpp

@ -119,9 +119,6 @@ void GcodeSuite::dwell(millis_t time) {
extern void gcode_M163();
extern void gcode_M164();
extern void gcode_M165();
extern void gcode_M203();
extern void gcode_M204();
extern void gcode_M205();
extern void gcode_M206();
extern void gcode_M211();
extern void gcode_M220();
@ -536,15 +533,9 @@ void GcodeSuite::process_next_command() {
case 202: M202(); break; // Not used for Sprinter/grbl gen6
#endif
case 203: // M203: Set max feedrate (units/sec)
gcode_M203();
break;
case 204: // M204: Set acceleration
gcode_M204();
break;
case 205: // M205: Set advanced settings
gcode_M205();
break;
case 203: M203(); break; // M203: Set max feedrate (units/sec)
case 204: M204(); break; // M204: Set acceleration
case 205: M205(); break; // M205: Set advanced settings
#if HAS_M206_COMMAND
case 206: // M206: Set home offsets

Loading…
Cancel
Save