From 0a483d0973a39eb5232f9ede45756e13b8af6428 Mon Sep 17 00:00:00 2001 From: proddy Date: Tue, 2 Mar 2021 08:36:28 +0100 Subject: [PATCH] added EMSESP_DEBUG for better troubleshooting --- src/dallassensor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dallassensor.cpp b/src/dallassensor.cpp index 9e9591e4f..10577f5c8 100644 --- a/src/dallassensor.cpp +++ b/src/dallassensor.cpp @@ -64,7 +64,9 @@ void DallasSensor::loop() { if (state_ == State::IDLE) { if (time_now - last_activity_ >= READ_INTERVAL_MS) { - // LOG_DEBUG(F("Read sensor temperature")); // uncomment for debug +#ifdef EMSESP_DEBUG + LOG_DEBUG(F("Read sensor temperature")); +#endif if (bus_.reset() || parasite_) { YIELD; bus_.skip(); @@ -88,7 +90,9 @@ void DallasSensor::loop() { } } else if (state_ == State::READING) { if (temperature_convert_complete() && (time_now - last_activity_ > CONVERSION_MS)) { - // LOG_DEBUG(F("Scanning for sensors")); // uncomment for debug +#ifdef EMSESP_DEBUG + LOG_DEBUG(F("Scanning for sensors")); +#endif bus_.reset_search(); state_ = State::SCANNING; } else if (time_now - last_activity_ > READ_TIMEOUT_MS) {