Implement CNC_COORDINATE_SYSTEMS

This commit is contained in:
Scott Lahteine
2017-11-04 16:36:41 -05:00
parent 1b42fba39b
commit 1b40e9c464
10 changed files with 242 additions and 33 deletions

View File

@ -56,6 +56,11 @@ bool GcodeSuite::axis_relative_modes[] = AXIS_RELATIVE_MODES;
GcodeSuite::WorkspacePlane GcodeSuite::workspace_plane = PLANE_XY;
#endif
#if ENABLED(CNC_COORDINATE_SYSTEMS)
int8_t GcodeSuite::active_coordinate_system = -1; // machine space
float GcodeSuite::coordinate_system[MAX_COORDINATE_SYSTEMS][XYZ];
#endif
/**
* Set target_extruder from the T parameter or the active_extruder
*
@ -125,26 +130,11 @@ void GcodeSuite::dwell(millis_t time) {
#endif
/**
* Process a single command and dispatch it to its handler
* This is called from the main loop()
* Process the parsed command and dispatch it to its handler
*/
void GcodeSuite::process_next_command() {
char * const current_command = command_queue[cmd_queue_index_r];
if (DEBUGGING(ECHO)) {
SERIAL_ECHO_START();
SERIAL_ECHOLN(current_command);
#if ENABLED(M100_FREE_MEMORY_WATCHER)
SERIAL_ECHOPAIR("slot:", cmd_queue_index_r);
M100_dump_routine(" Command Queue:", (const char*)command_queue, (const char*)(command_queue + sizeof(command_queue)));
#endif
}
void GcodeSuite::process_parsed_command() {
KEEPALIVE_STATE(IN_HANDLER);
// Parse the next command in the queue
parser.parse(current_command);
// Handle a known G, M, or T
switch (parser.command_letter) {
case 'G': switch (parser.codenum) {
@ -711,6 +701,27 @@ void GcodeSuite::process_next_command() {
ok_to_send();
}
/**
* Process a single command and dispatch it to its handler
* This is called from the main loop()
*/
void GcodeSuite::process_next_command() {
char * const current_command = command_queue[cmd_queue_index_r];
if (DEBUGGING(ECHO)) {
SERIAL_ECHO_START();
SERIAL_ECHOLN(current_command);
#if ENABLED(M100_FREE_MEMORY_WATCHER)
SERIAL_ECHOPAIR("slot:", cmd_queue_index_r);
M100_dump_routine(" Command Queue:", (const char*)command_queue, (const char*)(command_queue + sizeof(command_queue)));
#endif
}
// Parse the next command in the queue
parser.parse(current_command);
process_parsed_command();
}
#if ENABLED(HOST_KEEPALIVE_FEATURE)
/**