Merge remote-tracking branch 'upstream/MK3_3.11.1' into mk311_sync

This commit is contained in:
Yuri D'Elia 2022-07-04 16:14:23 +02:00
commit e37435b53f
87 changed files with 43199 additions and 39577 deletions
Firmware

View file

@ -24,7 +24,7 @@ int serial_count = 0; //index of character read from serial line
bool comment_mode = false;
char *strchr_pointer; // just a pointer to find chars in the command string like X, Y, Z, E, etc
LongTimer farm_incomplete_command_timeout_timer;
ShortTimer serialTimeoutTimer;
long gcode_N = 0;
long gcode_LastN = 0;
@ -394,7 +394,7 @@ void get_command()
char serial_char = MYSERIAL.read();
farm_incomplete_command_timeout_timer.start();
serialTimeoutTimer.start();
if (serial_char < 0)
// Ignore extended ASCII characters. These characters have no meaning in the G-code apart from the file names
@ -526,21 +526,11 @@ void get_command()
}
} // end of serial line processing loop
if(farm_mode && (serial_count > 0)){
if (farm_incomplete_command_timeout_timer.expired(800)) {
cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0;
bufindw += strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE);
if (bufindw == sizeof(cmdbuffer))
bufindw = 0;
++ buflen;
serial_count = 0;
SERIAL_ECHOPGM("TIMEOUT:");
//memset(cmdbuffer, 0 , sizeof(cmdbuffer));
return;
}
if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) {
comment_mode = false;
serial_count = 0;
SERIAL_ECHOLNPGM("RX timeout");
return;
}
#ifdef SDSUPPORT