TimeNow && TimeSent
This commit is contained in:
parent
f64c6c2a39
commit
a5f1f23fe2
2 changed files with 5 additions and 16 deletions
|
@ -26,8 +26,7 @@ int serial_count = 0; //index of character read from serial line
|
||||||
boolean comment_mode = false;
|
boolean comment_mode = false;
|
||||||
char *strchr_pointer; // just a pointer to find chars in the command string like X, Y, Z, E, etc
|
char *strchr_pointer; // just a pointer to find chars in the command string like X, Y, Z, E, etc
|
||||||
|
|
||||||
unsigned long TimeSent = _millis();
|
ShortTimer farm_incomplete_command_timeout_timer;
|
||||||
unsigned long TimeNow = _millis();
|
|
||||||
|
|
||||||
long gcode_N = 0;
|
long gcode_N = 0;
|
||||||
long gcode_LastN = 0;
|
long gcode_LastN = 0;
|
||||||
|
@ -396,14 +395,8 @@ void get_command()
|
||||||
while (((MYSERIAL.available() > 0 && !saved_printing) || (MYSERIAL.available() > 0 && isPrintPaused)) && !cmdqueue_serial_disabled) { //is print is saved (crash detection or filament detection), dont process data from serial line
|
while (((MYSERIAL.available() > 0 && !saved_printing) || (MYSERIAL.available() > 0 && isPrintPaused)) && !cmdqueue_serial_disabled) { //is print is saved (crash detection or filament detection), dont process data from serial line
|
||||||
|
|
||||||
char serial_char = MYSERIAL.read();
|
char serial_char = MYSERIAL.read();
|
||||||
/* if (selectedSerialPort == 1)
|
|
||||||
{
|
farm_incomplete_command_timeout_timer.start();
|
||||||
selectedSerialPort = 0;
|
|
||||||
MYSERIAL.write(serial_char); // for debuging serial line 2 in farm_mode
|
|
||||||
selectedSerialPort = 1;
|
|
||||||
} */ //RP - removed
|
|
||||||
TimeSent = _millis();
|
|
||||||
TimeNow = _millis();
|
|
||||||
|
|
||||||
if (serial_char < 0)
|
if (serial_char < 0)
|
||||||
// Ignore extended ASCII characters. These characters have no meaning in the G-code apart from the file names
|
// Ignore extended ASCII characters. These characters have no meaning in the G-code apart from the file names
|
||||||
|
@ -537,9 +530,8 @@ void get_command()
|
||||||
}
|
}
|
||||||
} // end of serial line processing loop
|
} // end of serial line processing loop
|
||||||
|
|
||||||
if(farm_mode){
|
if(farm_mode && (serial_count > 0)){
|
||||||
TimeNow = _millis();
|
if (farm_incomplete_command_timeout_timer.expired(800)) {
|
||||||
if ( ((TimeNow - TimeSent) > 800) && (serial_count > 0) ) {
|
|
||||||
cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0;
|
cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0;
|
||||||
|
|
||||||
bufindw += strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE);
|
bufindw += strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE);
|
||||||
|
|
|
@ -52,9 +52,6 @@ extern int serial_count;
|
||||||
extern boolean comment_mode;
|
extern boolean comment_mode;
|
||||||
extern char *strchr_pointer;
|
extern char *strchr_pointer;
|
||||||
|
|
||||||
extern unsigned long TimeSent;
|
|
||||||
extern unsigned long TimeNow;
|
|
||||||
|
|
||||||
extern long gcode_N;
|
extern long gcode_N;
|
||||||
extern long gcode_LastN;
|
extern long gcode_LastN;
|
||||||
extern long Stopped_gcode_LastN;
|
extern long Stopped_gcode_LastN;
|
||||||
|
|
Loading…
Add table
Reference in a new issue