Skip to content

Commit f1b31c6

Browse files
committed
Fix wrong detection of [ESPXXX]Command if used in macro or web command and sent to printer using M118
1 parent 91c39aa commit f1b31c6

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

esp3d/command.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1828,9 +1828,10 @@ bool COMMAND::execute_command (int cmd, String cmd_params, tpipe output, level_a
18281828
String currentline = currentfile.readStringUntil('\n');
18291829
currentline.replace("\n","");
18301830
currentline.replace("\r","");
1831+
currentline.trim();
18311832
if (currentline.length() > 0) {
18321833
int ESPpos = currentline.indexOf ("[ESP");
1833-
if (ESPpos > -1) {
1834+
if (ESPpos ==0) {
18341835
//is there the second part?
18351836
int ESPpos2 = currentline.indexOf ("]", ESPpos);
18361837
if (ESPpos2 > -1) {

esp3d/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020

2121
//version and sources location
22-
#define FW_VERSION "2.1.1.b9"
22+
#define FW_VERSION "2.1.1.b10"
2323
#define REPOSITORY "https://github.com/luc-github/ESP3D"
2424

2525
//Customize ESP3D ////////////////////////////////////////////////////////////////////////

esp3d/syncwebserver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ void handle_web_command()
948948
//if it is for ESP module [ESPXXX]<parameter>
949949
cmd.trim();
950950
int ESPpos = cmd.indexOf("[ESP");
951-
if (ESPpos>-1) {
951+
if (ESPpos==0) {
952952
//is there the second part?
953953
int ESPpos2 = cmd.indexOf("]",ESPpos);
954954
if (ESPpos2>-1) {
@@ -1137,7 +1137,7 @@ void handle_web_command_silent()
11371137
//if it is for ESP module [ESPXXX]<parameter>
11381138
cmd.trim();
11391139
int ESPpos = cmd.indexOf("[ESP");
1140-
if (ESPpos>-1) {
1140+
if (ESPpos==0) {
11411141
//is there the second part?
11421142
int ESPpos2 = cmd.indexOf("]",ESPpos);
11431143
if (ESPpos2>-1) {

0 commit comments

Comments
 (0)