|
|
|
@ -732,12 +732,15 @@ void get_command()
|
|
|
|
|
serial_char == '\r' ||
|
|
|
|
|
serial_count >= (MAX_CMD_SIZE - 1) )
|
|
|
|
|
{
|
|
|
|
|
if(!serial_count) { //if empty line
|
|
|
|
|
comment_mode = false; //for new command
|
|
|
|
|
// end of line == end of comment
|
|
|
|
|
comment_mode = false;
|
|
|
|
|
|
|
|
|
|
if(!serial_count) {
|
|
|
|
|
// short cut for empty lines
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
cmdbuffer[bufindw][serial_count] = 0; //terminate string
|
|
|
|
|
if(!comment_mode){
|
|
|
|
|
|
|
|
|
|
fromsd[bufindw] = false;
|
|
|
|
|
if(strchr(cmdbuffer[bufindw], 'N') != NULL)
|
|
|
|
|
{
|
|
|
|
@ -818,14 +821,14 @@ void get_command()
|
|
|
|
|
|
|
|
|
|
bufindw = (bufindw + 1)%BUFSIZE;
|
|
|
|
|
buflen += 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
serial_count = 0; //clear buffer
|
|
|
|
|
}
|
|
|
|
|
else if(serial_char == '\\') { //Handle escapes
|
|
|
|
|
|
|
|
|
|
if(MYSERIAL.available() > 0 && buflen < BUFSIZE) {
|
|
|
|
|
// if we have one more character, copy it over
|
|
|
|
|
MYSERIAL.read();
|
|
|
|
|
serial_char = MYSERIAL.read();
|
|
|
|
|
cmdbuffer[bufindw][serial_count++] = serial_char;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|