Fix wrong detection of [ESPXXX]Command if used in macro or web command and sent to printer using M118

This commit is contained in:
Luc 2020-12-31 10:32:07 +01:00
parent 91c39aa570
commit f1b31c6864
3 changed files with 5 additions and 4 deletions

View File

@ -1828,9 +1828,10 @@ bool COMMAND::execute_command (int cmd, String cmd_params, tpipe output, level_a
String currentline = currentfile.readStringUntil('\n');
currentline.replace("\n","");
currentline.replace("\r","");
currentline.trim();
if (currentline.length() > 0) {
int ESPpos = currentline.indexOf ("[ESP");
if (ESPpos > -1) {
if (ESPpos ==0) {
//is there the second part?
int ESPpos2 = currentline.indexOf ("]", ESPpos);
if (ESPpos2 > -1) {

View File

@ -19,7 +19,7 @@
*/
//version and sources location
#define FW_VERSION "2.1.1.b9"
#define FW_VERSION "2.1.1.b10"
#define REPOSITORY "https://github.com/luc-github/ESP3D"
//Customize ESP3D ////////////////////////////////////////////////////////////////////////

View File

@ -948,7 +948,7 @@ void handle_web_command()
//if it is for ESP module [ESPXXX]<parameter>
cmd.trim();
int ESPpos = cmd.indexOf("[ESP");
if (ESPpos>-1) {
if (ESPpos==0) {
//is there the second part?
int ESPpos2 = cmd.indexOf("]",ESPpos);
if (ESPpos2>-1) {
@ -1137,7 +1137,7 @@ void handle_web_command_silent()
//if it is for ESP module [ESPXXX]<parameter>
cmd.trim();
int ESPpos = cmd.indexOf("[ESP");
if (ESPpos>-1) {
if (ESPpos==0) {
//is there the second part?
int ESPpos2 = cmd.indexOf("]",ESPpos);
if (ESPpos2>-1) {