Skip to content

Commit 535f26c

Browse files
author
Luc
committed
Allow to disable Serial ESP commands
Web commands are still working, only input from serial is disabled for ESP module not for printer,
1 parent ba84a06 commit 535f26c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

esp8266/command.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ void COMMAND::execute_command(int cmd,String cmd_params)
130130

131131
void COMMAND::check_command(String buffer)
132132
{
133-
String ESP_Command;
134133
static bool bfileslist=false;
135134
static uint32_t start_list=0;
136135
if (!bfileslist) {
@@ -141,7 +140,6 @@ void COMMAND::check_command(String buffer)
141140
bfileslist=true;
142141
web_interface->fileslist.clear();
143142
}
144-
int ESPpos = buffer.indexOf("[ESP");
145143
int Tpos = buffer.indexOf("T:");
146144
int Xpos = buffer.indexOf("X:");
147145
int Ypos = buffer.indexOf("Y:");
@@ -151,6 +149,9 @@ void COMMAND::check_command(String buffer)
151149
int Errorpos= buffer.indexOf("Error:");
152150
int Infopos= buffer.indexOf("Info:");
153151
int Statuspos= buffer.indexOf("Status:");
152+
#ifdef SERIAL_COMMAND_FEATURE
153+
String ESP_Command;
154+
int ESPpos = buffer.indexOf("[ESP");
154155
if (ESPpos>-1) {
155156
//is there the second part?
156157
int ESPpos2 = buffer.indexOf("]",ESPpos);
@@ -169,6 +170,7 @@ void COMMAND::check_command(String buffer)
169170
//if not is not a valid [ESPXXX] command
170171
}
171172
}
173+
#endif
172174
//check for temperature
173175
if (Tpos>-1) {
174176
//look for valid temperature answer

esp8266/config.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
//WEB_UPDATE_FEATURE: allow to flash fw using web UI
3636
#define WEB_UPDATE_FEATURE
3737

38+
//SERIAL_COMMAND_FEATURE: allow to send command by serial
39+
#define SERIAL_COMMAND_FEATURE
40+
3841
#ifndef CONFIG_h
3942
#define CONFIG_h
4043

0 commit comments

Comments
 (0)