From bfc54aeb821b09973f7845b1ccdcabadb41bba34 Mon Sep 17 00:00:00 2001 From: netpipe Date: Mon, 22 Apr 2019 21:11:04 -0600 Subject: [PATCH] add m118 support --- src/ArduinoDUE/Repetier/Commands.cpp | 5 +++++ src/ArduinoDUE/Repetier/gcode.cpp | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ArduinoDUE/Repetier/Commands.cpp b/src/ArduinoDUE/Repetier/Commands.cpp index fc48854..7048d51 100644 --- a/src/ArduinoDUE/Repetier/Commands.cpp +++ b/src/ArduinoDUE/Repetier/Commands.cpp @@ -2052,6 +2052,11 @@ void Commands::processMCode(GCode *com) { UI_STATUS_UPD_RAM(com->text); } break; + case 118: // M118 message to host + if(com->hasString()) { + Com::printF(com->text); + } + break; case 119: // M119 Commands::waitUntilEndOfAllMoves(); Endstops::update(); diff --git a/src/ArduinoDUE/Repetier/gcode.cpp b/src/ArduinoDUE/Repetier/gcode.cpp index 778e3ca..0ab902e 100644 --- a/src/ArduinoDUE/Repetier/gcode.cpp +++ b/src/ArduinoDUE/Repetier/gcode.cpp @@ -773,7 +773,7 @@ bool GCode::parseAscii(char *line,bool fromSerial) params |= 2; if(M > 255) params |= 4096; // handle non standard text arguments that some M codes have - if (M == 20 || M == 23 || M == 28 || M == 29 || M == 30 || M == 32 || M == 36 || M == 117) + if (M == 20 || M == 23 || M == 28 || M == 29 || M == 30 || M == 32 || M == 36 || M == 117 || M == 118) { // after M command we got a filename or text char digit; @@ -793,6 +793,8 @@ bool GCode::parseAscii(char *line,bool fromSerial) { if((M != 117 && M != 20 && *pos==' ') || *pos=='*') break; pos++; // find a space as file name end + if((M != 118 && M != 20 && *pos==' ') || *pos=='*') break; + pos++; // find a space as file name end } *pos = 0; // truncate filename by erasing space with null, also skips checksum waitUntilAllCommandsAreParsed = true; // don't risk string be deleted