Code optimisations in effects.

Remove Wire initialisation from RTC.
Peek fix.
This commit is contained in:
Blaz Kristan
2022-08-09 21:14:37 +02:00
parent 7befafe7b7
commit 957948f906
14 changed files with 1459 additions and 1558 deletions

View File

@@ -22,6 +22,7 @@ class RTCUsermod : public Usermod {
void setup() {
PinManagerPinType pins[2] = { { HW_PIN_SCL, true }, { HW_PIN_SDA, true } };
if (!pinManager.allocateMultiplePins(pins, 2, PinOwner::HW_I2C)) { disabled = true; return; }
RTC.begin();
time_t rtcTime = RTC.get();
if (rtcTime) {
toki.setTime(rtcTime,TOKI_NO_MS_ACCURACY,TOKI_TS_RTC);