diff --git a/src/main.cpp b/src/main.cpp index 5b6543e..332ff60 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,6 +16,18 @@ static const char *TAG = "server"; +static bool serialMuted = false; + +static void muteSerial() { + serialMuted = true; + esp_log_level_set("*", ESP_LOG_NONE); +} + +static void unmuteSerial() { + serialMuted = false; + esp_log_level_set("*", CONFIG_LOG_DEFAULT_LEVEL); +} + #define RELAY1_PIN 1 #define RELAY2_PIN 2 #define TOUCH1_PIN 8 @@ -589,7 +601,11 @@ void loop() { Serial.println("NO_KEY"); } } else if (serialBuf == "ID?") { + Serial.flush(); + muteSerial(); Serial.println("SylDa_Server"); + delay(50); + unmuteSerial(); } else if (serialBuf == "VERSION?") { Serial.flush(); Serial.print("BUILD_NR:");