From 535f26cdf5eb48e3e5ed1f19bdce32685254e1a1 Mon Sep 17 00:00:00 2001 From: Luc Date: Mon, 1 Feb 2016 23:13:25 +0800 Subject: [PATCH] Allow to disable Serial ESP commands Web commands are still working, only input from serial is disabled for ESP module not for printer, --- esp8266/command.cpp | 6 ++++-- esp8266/config.h | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/esp8266/command.cpp b/esp8266/command.cpp index 73ab1de8..e9d36b3a 100644 --- a/esp8266/command.cpp +++ b/esp8266/command.cpp @@ -130,7 +130,6 @@ void COMMAND::execute_command(int cmd,String cmd_params) void COMMAND::check_command(String buffer) { - String ESP_Command; static bool bfileslist=false; static uint32_t start_list=0; if (!bfileslist) { @@ -141,7 +140,6 @@ void COMMAND::check_command(String buffer) bfileslist=true; web_interface->fileslist.clear(); } - int ESPpos = buffer.indexOf("[ESP"); int Tpos = buffer.indexOf("T:"); int Xpos = buffer.indexOf("X:"); int Ypos = buffer.indexOf("Y:"); @@ -151,6 +149,9 @@ void COMMAND::check_command(String buffer) int Errorpos= buffer.indexOf("Error:"); int Infopos= buffer.indexOf("Info:"); int Statuspos= buffer.indexOf("Status:"); +#ifdef SERIAL_COMMAND_FEATURE + String ESP_Command; + int ESPpos = buffer.indexOf("[ESP"); if (ESPpos>-1) { //is there the second part? int ESPpos2 = buffer.indexOf("]",ESPpos); @@ -169,6 +170,7 @@ void COMMAND::check_command(String buffer) //if not is not a valid [ESPXXX] command } } +#endif //check for temperature if (Tpos>-1) { //look for valid temperature answer diff --git a/esp8266/config.h b/esp8266/config.h index 9c977701..600be435 100644 --- a/esp8266/config.h +++ b/esp8266/config.h @@ -35,6 +35,9 @@ //WEB_UPDATE_FEATURE: allow to flash fw using web UI #define WEB_UPDATE_FEATURE +//SERIAL_COMMAND_FEATURE: allow to send command by serial +#define SERIAL_COMMAND_FEATURE + #ifndef CONFIG_h #define CONFIG_h