write_command() no line number handling

This commit is contained in:
Voinea Dragos 2021-06-22 12:28:37 +03:00 committed by DRracer
parent 53fcd6fc8f
commit ecce6f865f

View File

@ -596,20 +596,9 @@ void CardReader::getStatus(bool arg_P)
} }
void CardReader::write_command(char *buf) void CardReader::write_command(char *buf)
{ {
char* begin = buf;
char* npos = 0;
char* end = buf + strlen(buf) - 1;
file.writeError = false; file.writeError = false;
if((npos = strchr(buf, 'N')) != NULL) file.write(buf); //write command
{ file.write("\r\n"); //write line termination
begin = strchr(npos, ' ') + 1;
end = strchr(npos, '*') - 1;
}
end[1] = '\r';
end[2] = '\n';
end[3] = '\0';
file.write(begin);
if (file.writeError) if (file.writeError)
{ {
SERIAL_ERROR_START; SERIAL_ERROR_START;