From 0130899b3b76b48cfc0d396dcddc9bfc463c692f Mon Sep 17 00:00:00 2001 From: tg-mw <81423559+tg-mw@users.noreply.github.com> Date: Mon, 4 Aug 2025 18:42:39 +0200 Subject: [PATCH] Fix Melopero RV3028 RTC Settings (#7524) --- src/detect/ScanI2CTwoWire.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 652d50d51..8b3670cd9 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -184,8 +184,13 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) type = RTC_RV3028; logFoundDevice("RV3028", (uint8_t)addr.address); rtc.initI2C(*i2cBus); - rtc.writeToRegister(0x35, 0x07); // no Clkout - rtc.writeToRegister(0x37, 0xB4); + // Update RTC EEPROM settings, if necessary + if (rtc.readEEPROMRegister(0x35) != 0x07) { + rtc.writeEEPROMRegister(0x35, 0x07); // no Clkout + } + if (rtc.readEEPROMRegister(0x37) != 0xB4) { + rtc.writeEEPROMRegister(0x37, 0xB4); + } break; #endif