Skip to content

Commit 2ca1d45

Browse files
committed
Fix corrupted status with Marlin in some occasions
1 parent 9d49909 commit 2ca1d45

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

esp3d/command.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -674,27 +674,36 @@ bool COMMAND::check_command(String buffer, tpipe output, bool handlelockserial)
674674
#ifdef ERROR_MSG_FEATURE
675675
//Error
676676
if (Errorpos>-1 && !(buffer.indexOf("Format error")!=-1 || buffer.indexOf("wait")==Errorpos+6) ) {
677-
(web_interface->error_msg).add(buffer.substring(Errorpos+6).c_str());
677+
String ss = buffer.substring(Errorpos+6);
678+
ss.replace("\"","");
679+
ss.replace("'","");
680+
(web_interface->error_msg).add(ss.c_str());
678681
}
679682
#endif
680683
#ifdef INFO_MSG_FEATURE
681684
//Info
682685
if (Infopos>-1) {
683-
(web_interface->info_msg).add(buffer.substring(Infopos+5).c_str());
686+
String ss = buffer.substring(Errorpos+5);
687+
ss.replace("\"","");
688+
ss.replace("'","");
689+
(web_interface->info_msg).add(ss.c_str());
684690
}
685691
#endif
686692
#ifdef STATUS_MSG_FEATURE
687693
//Status
688694
if (Statuspos>-1) {
689695
#if FIRMWARE_TARGET == SMOOTHIEWARE
690-
(web_interface->status_msg).add(buffer.substring(Statuspos+8).c_str());
696+
String ss = buffer.substring(Errorpos+8);
691697
#else
692698
#if FIRMWARE_TARGET == MARLIN
693-
(web_interface->status_msg).add(buffer.substring(Statuspos+5).c_str());
699+
String ss = buffer.substring(Errorpos+5);
694700
#else
695-
(web_interface->status_msg).add(buffer.substring(Statuspos+7).c_str());
701+
String ss = buffer.substring(Errorpos+7);
696702
#endif
697703
#endif
704+
ss.replace("\"","");
705+
ss.replace("'","");
706+
(web_interface->info_msg).add(ss.c_str());
698707
}
699708
#endif
700709
#ifndef DIRECT_SDCARD_FEATURE

esp3d/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ extern "C" {
151151
}
152152
#include "wifi.h"
153153
//version and sources location
154-
#define FW_VERSION "0.9.77"
154+
#define FW_VERSION "0.9.78"
155155
#define REPOSITORY "https://github.com/luc-github/ESP3D"
156156

157157
typedef enum {

0 commit comments

Comments
 (0)