Move G17-G19 to cpp

This commit is contained in:
Scott Lahteine
2017-09-15 23:08:48 -05:00
parent 94d9def81c
commit 9b4aa5ea8b
6 changed files with 42 additions and 31 deletions

View File

@ -20,10 +20,25 @@
*
*/
void report_workspace_plane() {
#include "../../inc/MarlinConfig.h"
#if ENABLED(CNC_WORKSPACE_PLANES)
#include "../gcode.h"
inline void report_workspace_plane() {
SERIAL_ECHO_START();
SERIAL_ECHOPGM("Workspace Plane ");
serialprintPGM(workspace_plane == PLANE_YZ ? PSTR("YZ\n") : workspace_plane == PLANE_ZX ? PSTR("ZX\n") : PSTR("XY\n"));
serialprintPGM(
gcode.workspace_plane == GcodeSuite::PLANE_YZ ? PSTR("YZ\n")
: gcode.workspace_plane == GcodeSuite::PLANE_ZX ? PSTR("ZX\n")
: PSTR("XY\n")
);
}
inline void set_workspace_plane(const GcodeSuite::WorkspacePlane plane) {
gcode.workspace_plane = plane;
if (DEBUGGING(INFO)) report_workspace_plane();
}
/**
@ -31,6 +46,8 @@ void report_workspace_plane() {
* G18: Select Plane ZX
* G19: Select Plane YZ
*/
void gcode_G17() { workspace_plane = PLANE_XY; }
void gcode_G18() { workspace_plane = PLANE_ZX; }
void gcode_G19() { workspace_plane = PLANE_YZ; }
void GcodeSuite::G17() { set_workspace_plane(PLANE_XY); }
void GcodeSuite::G18() { set_workspace_plane(PLANE_ZX); }
void GcodeSuite::G19() { set_workspace_plane(PLANE_YZ); }
#endif // CNC_WORKSPACE_PLANES