Added number of character count for not recognizing S0 and S00 command and recognizing P000,R000 and S000 only.

This commit is contained in:
fedetony 2020-09-12 12:35:01 +02:00
parent 23250e35e0
commit 0c418375c4
3 changed files with 11 additions and 4 deletions

View file

@ -260,11 +260,11 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
}
#endif
// Handle a known G, M, or T
// Handle a known G, M, or T (S,P & R from emergency parser)
switch (parser.command_letter) {
#if ENABLED(FULL_REPORT_TO_HOST_FEATURE)
case 'S': case 'P': case 'R': switch (parser.codenum) {
case 0: break;
case 0: if(parser.numchars==3) break;
default: parser.unknown_command_warning(); break;
}
break;

View file

@ -50,6 +50,7 @@ char *GCodeParser::command_ptr,
*GCodeParser::value_ptr;
char GCodeParser::command_letter;
int GCodeParser::codenum;
int GCodeParser::numchars;
#if ENABLED(USE_GCODE_SUBCODES)
uint8_t GCodeParser::subcode;
@ -166,7 +167,12 @@ void GCodeParser::parse(char *p) {
command_letter = letter;
// Get the code number - integer digits only
codenum = 0;
do { codenum *= 10, codenum += *p++ - '0'; } while (NUMERIC(*p));
numchars=0;
while (NUMERIC(*p)) {
codenum += *p++ - '0';
codenum *= 10;
numchars++;
}
return;
default: break;

View file

@ -85,6 +85,7 @@ public:
*string_arg, // string of command line
command_letter; // G, M, or T
static int codenum; // 123
static int numchars; // 123
#if ENABLED(USE_GCODE_SUBCODES)
static uint8_t subcode; // .1
#endif