Improve setClock and restoreClock cases

This commit is contained in:
oscgonfer
2026-06-14 14:48:40 +02:00
parent 70588f01e5
commit 8b08431fd7
+2
View File
@@ -51,6 +51,7 @@ class ReClockI2C
} }
LOG_DEBUG("I2C clock was already %uHz. Skipping", desiredClock); LOG_DEBUG("I2C clock was already %uHz. Skipping", desiredClock);
setPreviousClock(0);
return false; return false;
} }
@@ -59,6 +60,7 @@ class ReClockI2C
if (this->previousClock) { if (this->previousClock) {
LOG_DEBUG("Restoring I2C clock to %uHz", this->previousClock); LOG_DEBUG("Restoring I2C clock to %uHz", this->previousClock);
i2cBus->setClock(this->previousClock); i2cBus->setClock(this->previousClock);
setPreviousClock(0);
return true; return true;
} }
LOG_DEBUG("I2C clock was unknown. Not restored"); LOG_DEBUG("I2C clock was unknown. Not restored");