Fix bug reading Macro on SPIFFS

This commit is contained in:
luc lebosse 2018-02-24 21:34:52 +01:00
parent e7252dca66
commit 2714904c52
2 changed files with 30 additions and 29 deletions

View File

@ -1217,10 +1217,12 @@ 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) {
while (currentfile.available()) {
String currentline = currentfile.readStringUntil('\n');
currentline.replace("\n","");
currentline.replace("\r","");
if (currentline.length() > 0) {
int ESPpos = currentline.indexOf("[ESP");
if (ESPpos>-1) {
//is there the second part?
@ -1246,9 +1248,8 @@ bool COMMAND::execute_command(int cmd,String cmd_params, tpipe output, level_aut
delay(0);
ESP_SERIAL_OUT.flush();
}
currentline="";
//read next line if any
currentline = currentfile.readString();
delay(0);
}
}
currentfile.close();
BRIDGE::println(OK_CMD_MSG, output);

View File

@ -186,7 +186,7 @@ extern "C" {
#endif
#include "wificonf.h"
//version and sources location
#define FW_VERSION "0.9.99"
#define FW_VERSION "0.9.100"
#define REPOSITORY "https://github.com/luc-github/ESP3D"
typedef enum {