Skip to content

Commit 9e3fb4f

Browse files
use TwoWire instance
1 parent 469fd32 commit 9e3fb4f

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

SystemClock/SystemClock.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2020-2021, Collab
1+
/* Copyright (c) 2020-2023, Collab
22
* All rights reserved
33
*/
44
/*
@@ -8,8 +8,7 @@
88
#include "SystemClock.h"
99

1010
SystemClock::SystemClock(
11-
int scl_pin,
12-
int sda_pin,
11+
TwoWire* wire,
1312
char *ntp_server,
1413
long int gmtOffset_sec,
1514
int daylightOffset_sec)
@@ -18,11 +17,11 @@ SystemClock::SystemClock(
1817
_gmtOffset_sec = gmtOffset_sec;
1918
_daylightOffset_sec = daylightOffset_sec;
2019

21-
_clock = new DS3231_RealtimeClock(scl_pin, sda_pin);
20+
_clock = new DS3231_RealtimeClock(wire);
2221
}
2322

2423
void SystemClock::begin() {
25-
_clock->begin(false);
24+
_clock->begin();
2625

2726
startupTime = _clock->startupTime;
2827
}

SystemClock/SystemClock.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2020-2021, Collab
1+
/* Copyright (c) 2020-2023, Collab
22
* All rights reserved
33
*/
44
/*
@@ -15,8 +15,7 @@ class SystemClock
1515
{
1616
public:
1717
SystemClock(
18-
int scl_pin,
19-
int sda_pin,
18+
TwoWire* wire,
2019
char *ntpServer = "pool.ntp.org",
2120
long int gmtOffset_sec = 3600,
2221
int daylightOffset_sec = 3600

0 commit comments

Comments
 (0)