Fix blocking M117 is blocking full serial

This commit is contained in:
Luc 2018-07-31 15:14:54 +02:00
parent e6f1d5be04
commit 38ec3ccfd3
2 changed files with 7 additions and 5 deletions

View File

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

View File

@ -141,7 +141,7 @@ size_t ESPCOM::available(tpipe output){
} }
} }
size_t ESPCOM::write(tpipe output, uint8_t d){ size_t ESPCOM::write(tpipe output, uint8_t d){
if ((DEFAULT_PRINTER_PIPE == output) && (block_2_printer || CONFIG::is_locked(FLAG_BLOCK_M117))) return 0; if ((DEFAULT_PRINTER_PIPE == output) && (block_2_printer || CONFIG::is_locked(FLAG_BLOCK_SERIAL))) return 0;
if ((SERIAL_PIPE == output) && CONFIG::is_locked(FLAG_BLOCK_SERIAL))return 0; if ((SERIAL_PIPE == output) && CONFIG::is_locked(FLAG_BLOCK_SERIAL))return 0;
switch (output) { switch (output) {
#ifdef USE_SERIAL_0 #ifdef USE_SERIAL_0
@ -213,7 +213,7 @@ void ESPCOM::print (String & data, tpipe output, ESPResponseStream *espresponse
} }
void ESPCOM::print (const char * data, tpipe output, ESPResponseStream *espresponse) void ESPCOM::print (const char * data, tpipe output, ESPResponseStream *espresponse)
{ {
if ((DEFAULT_PRINTER_PIPE == output) && ( block_2_printer || CONFIG::is_locked(FLAG_BLOCK_M117))) return; if ((DEFAULT_PRINTER_PIPE == output) && ( block_2_printer || CONFIG::is_locked(FLAG_BLOCK_SERIAL))) return;
if ((SERIAL_PIPE == output) && CONFIG::is_locked(FLAG_BLOCK_SERIAL))return; if ((SERIAL_PIPE == output) && CONFIG::is_locked(FLAG_BLOCK_SERIAL))return;
#ifdef TCP_IP_DATA_FEATURE #ifdef TCP_IP_DATA_FEATURE
if ((TCP_PIPE == output) && CONFIG::is_locked(FLAG_BLOCK_TCP))return; if ((TCP_PIPE == output) && CONFIG::is_locked(FLAG_BLOCK_TCP))return;
@ -297,8 +297,10 @@ void ESPCOM::print (const char * data, tpipe output, ESPResponseStream *espresp
OLED_DISPLAY::setCursor(0, 48); OLED_DISPLAY::setCursor(0, 48);
if(!(!strcmp(data,"\n")||!strcmp(data,"\r")||!strcmp(data,"\r\n")))ESPCOM::print(data, OLED_PIPE); if(!(!strcmp(data,"\n")||!strcmp(data,"\r")||!strcmp(data,"\r\n")))ESPCOM::print(data, OLED_PIPE);
#endif #endif
if(!(!strcmp(data,"\n")||!strcmp(data,"\r")||!strcmp(data,"\r\n")))ESPCOM::print ("M117 ", DEFAULT_PRINTER_PIPE); if (!CONFIG::is_locked(FLAG_BLOCK_M117)){
ESPCOM::print (data, DEFAULT_PRINTER_PIPE); if(!(!strcmp(data,"\n")||!strcmp(data,"\r")||!strcmp(data,"\r\n")))ESPCOM::print ("M117 ", DEFAULT_PRINTER_PIPE);
ESPCOM::print (data, DEFAULT_PRINTER_PIPE);
}
} }
break; break;
default: default: