diff --git a/esp3d/command.cpp b/esp3d/command.cpp index a40647a7..c90ea6fc 100644 --- a/esp3d/command.cpp +++ b/esp3d/command.cpp @@ -1217,38 +1217,39 @@ bool COMMAND::execute_command(int cmd,String cmd_params, tpipe output, level_aut if (currentfile) {//if file open success //flush to be sure send buffer is empty ESP_SERIAL_OUT.flush(); - //read content - String currentline = currentfile.readString(); //until no line in file - while (currentline.length() >0) { - int ESPpos = currentline.indexOf("[ESP"); - if (ESPpos>-1) { - //is there the second part? - int ESPpos2 = currentline.indexOf("]",ESPpos); - if (ESPpos2>-1) { - //Split in command and parameters - String cmd_part1=currentline.substring(ESPpos+4,ESPpos2); - String cmd_part2=""; - //is there space for parameters? - if (ESPpos2 0) { + int ESPpos = currentline.indexOf("[ESP"); + if (ESPpos>-1) { + //is there the second part? + int ESPpos2 = currentline.indexOf("]",ESPpos); + if (ESPpos2>-1) { + //Split in command and parameters + String cmd_part1=currentline.substring(ESPpos+4,ESPpos2); + String cmd_part2=""; + //is there space for parameters? + if (ESPpos2