From 844dac8e3cb75c09d1771cdf33e72cbda4852646 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 16 Jul 2025 14:50:46 +0200 Subject: [PATCH] make diag messages conditional --- DCCTimerESP.cpp | 4 +++- MotorDriver.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/DCCTimerESP.cpp b/DCCTimerESP.cpp index afbd2da..d93f539 100644 --- a/DCCTimerESP.cpp +++ b/DCCTimerESP.cpp @@ -203,7 +203,9 @@ void DCCTimer::DCCEXanalogWriteFrequencyInternal(uint8_t pin, uint32_t frequency } void DCCTimer::DCCEXledcDetachPin(uint8_t pin) { - DIAG(F("Clear pin %d channel"), pin); +#ifdef DIAG_IO + DIAG(F("Clear pin %d from ledc channel"), pin); +#endif pin_to_channel[pin] = 0; pinMatrixOutDetach(pin, false, false); } diff --git a/MotorDriver.cpp b/MotorDriver.cpp index 39ec08d..30e4ec2 100644 --- a/MotorDriver.cpp +++ b/MotorDriver.cpp @@ -242,7 +242,7 @@ void MotorDriver::setPower(POWERMODE mode) { // when switching a track On, we need to check the crrentOffset with the pin OFF if (powerMode==POWERMODE::OFF && currentPin!=UNUSED_PIN) { senseOffset = ADCee::read(currentPin); - DIAG(F("Track %c sensOffset=%d"),trackLetter,senseOffset); + if (Diag::ACK) DIAG(F("Track %c sensOffset=%d"),trackLetter,senseOffset); } IODevice::write(powerPin,invertPower ? LOW : HIGH);