Fix corrupted status with Marlin in some occasions

This commit is contained in:
luc lebosse 2017-03-29 09:23:05 +02:00
parent 9d49909f25
commit 2ca1d45111
2 changed files with 15 additions and 6 deletions

View File

@ -674,27 +674,36 @@ bool COMMAND::check_command(String buffer, tpipe output, bool handlelockserial)
#ifdef ERROR_MSG_FEATURE #ifdef ERROR_MSG_FEATURE
//Error //Error
if (Errorpos>-1 && !(buffer.indexOf("Format error")!=-1 || buffer.indexOf("wait")==Errorpos+6) ) { if (Errorpos>-1 && !(buffer.indexOf("Format error")!=-1 || buffer.indexOf("wait")==Errorpos+6) ) {
(web_interface->error_msg).add(buffer.substring(Errorpos+6).c_str()); String ss = buffer.substring(Errorpos+6);
ss.replace("\"","");
ss.replace("'","");
(web_interface->error_msg).add(ss.c_str());
} }
#endif #endif
#ifdef INFO_MSG_FEATURE #ifdef INFO_MSG_FEATURE
//Info //Info
if (Infopos>-1) { if (Infopos>-1) {
(web_interface->info_msg).add(buffer.substring(Infopos+5).c_str()); String ss = buffer.substring(Errorpos+5);
ss.replace("\"","");
ss.replace("'","");
(web_interface->info_msg).add(ss.c_str());
} }
#endif #endif
#ifdef STATUS_MSG_FEATURE #ifdef STATUS_MSG_FEATURE
//Status //Status
if (Statuspos>-1) { if (Statuspos>-1) {
#if FIRMWARE_TARGET == SMOOTHIEWARE #if FIRMWARE_TARGET == SMOOTHIEWARE
(web_interface->status_msg).add(buffer.substring(Statuspos+8).c_str()); String ss = buffer.substring(Errorpos+8);
#else #else
#if FIRMWARE_TARGET == MARLIN #if FIRMWARE_TARGET == MARLIN
(web_interface->status_msg).add(buffer.substring(Statuspos+5).c_str()); String ss = buffer.substring(Errorpos+5);
#else #else
(web_interface->status_msg).add(buffer.substring(Statuspos+7).c_str()); String ss = buffer.substring(Errorpos+7);
#endif #endif
#endif #endif
ss.replace("\"","");
ss.replace("'","");
(web_interface->info_msg).add(ss.c_str());
} }
#endif #endif
#ifndef DIRECT_SDCARD_FEATURE #ifndef DIRECT_SDCARD_FEATURE

View File

@ -151,7 +151,7 @@ extern "C" {
} }
#include "wifi.h" #include "wifi.h"
//version and sources location //version and sources location
#define FW_VERSION "0.9.77" #define FW_VERSION "0.9.78"
#define REPOSITORY "https://github.com/luc-github/ESP3D" #define REPOSITORY "https://github.com/luc-github/ESP3D"
typedef enum { typedef enum {