add m118 support

pull/345/head
netpipe 2019-04-22 21:11:04 -06:00
rodzic 2cdea0bf1d
commit bfc54aeb82
2 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -2052,6 +2052,11 @@ void Commands::processMCode(GCode *com) {
UI_STATUS_UPD_RAM(com->text); UI_STATUS_UPD_RAM(com->text);
} }
break; break;
case 118: // M118 message to host
if(com->hasString()) {
Com::printF(com->text);
}
break;
case 119: // M119 case 119: // M119
Commands::waitUntilEndOfAllMoves(); Commands::waitUntilEndOfAllMoves();
Endstops::update(); Endstops::update();

Wyświetl plik

@ -773,7 +773,7 @@ bool GCode::parseAscii(char *line,bool fromSerial)
params |= 2; params |= 2;
if(M > 255) params |= 4096; if(M > 255) params |= 4096;
// handle non standard text arguments that some M codes have // 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 // after M command we got a filename or text
char digit; char digit;
@ -793,6 +793,8 @@ bool GCode::parseAscii(char *line,bool fromSerial)
{ {
if((M != 117 && M != 20 && *pos==' ') || *pos=='*') break; if((M != 117 && M != 20 && *pos==' ') || *pos=='*') break;
pos++; // find a space as file name end 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 *pos = 0; // truncate filename by erasing space with null, also skips checksum
waitUntilAllCommandsAreParsed = true; // don't risk string be deleted waitUntilAllCommandsAreParsed = true; // don't risk string be deleted