Move M203-M205 to cpp

This commit is contained in:
Scott Lahteine 2017-09-17 01:38:58 -05:00
parent b3822b9242
commit 7aca9fe2f7
5 changed files with 15 additions and 19 deletions

View File

@ -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

View File

@ -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();

View File

@ -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);

View File

@ -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();

View File

@ -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