From 1b9dc1004cbb4d929d6b9180345cc7af3ddadd7e Mon Sep 17 00:00:00 2001 From: Marco Lopes <4539516+Matoran@users.noreply.github.com> Date: Sat, 6 Aug 2022 17:48:10 +0200 Subject: [PATCH] init DS1307RTC only if needed DS1307RTC is only required by USERMOD_RTC and USERMOD_ELEKSTUBE_IPS. If we don't use it, we do not want to execute `Wire.begin();` which configure gpio port 21 et 22 as I2C ports. This created a regression as it was possible to use gpio 21 and 22 for relays. --- wled00/src/dependencies/time/DS1307RTC.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wled00/src/dependencies/time/DS1307RTC.cpp b/wled00/src/dependencies/time/DS1307RTC.cpp index 2c16a8a339..bd81e20180 100644 --- a/wled00/src/dependencies/time/DS1307RTC.cpp +++ b/wled00/src/dependencies/time/DS1307RTC.cpp @@ -213,6 +213,6 @@ uint8_t DS1307RTC::bcd2dec(uint8_t num) } bool DS1307RTC::exists = false; - -DS1307RTC RTC = DS1307RTC(); // create an instance for the user - +#if defined(USERMOD_RTC) || defined(USERMOD_ELEKSTUBE_IPS) + DS1307RTC RTC = DS1307RTC(); // create an instance for the user +#endif