@@ -90,11 +90,13 @@ void ws_sdcard::calculateFileLimits() {
90
90
bool ws_sdcard::InitDS1307 () {
91
91
_rtc_ds1307 = new RTC_DS1307 ();
92
92
if (!_rtc_ds1307->begin ()) {
93
+ #ifndef ARDUINO_ARCH_ESP8266
93
94
if (!_rtc_ds1307->begin (&Wire1)) {
94
95
WS_DEBUG_PRINTLN (" [SD] Runtime Error: Failed to initialize DS1307 RTC" );
95
96
delete _rtc_ds1307;
96
97
return false ;
97
98
}
99
+ #endif
98
100
}
99
101
if (!_rtc_ds1307->isrunning ())
100
102
_rtc_ds1307->adjust (DateTime (F (__DATE__), F (__TIME__)));
@@ -112,11 +114,13 @@ bool ws_sdcard::InitDS3231() {
112
114
WS_DEBUG_PRINTLN (" Begin DS3231 init" );
113
115
_rtc_ds3231 = new RTC_DS3231 ();
114
116
if (!_rtc_ds3231->begin (&Wire)) {
117
+ #ifndef ARDUINO_ARCH_ESP8266
115
118
if (!_rtc_ds3231->begin (&Wire1)) {
116
119
WS_DEBUG_PRINTLN (" [SD] Runtime Error: Failed to initialize DS3231 RTC" );
117
120
delete _rtc_ds3231;
118
121
return false ;
119
122
}
123
+ #endif
120
124
}
121
125
if (_rtc_ds3231->lostPower ())
122
126
_rtc_ds3231->adjust (DateTime (F (__DATE__), F (__TIME__)));
@@ -135,12 +139,14 @@ bool ws_sdcard::InitPCF8523() {
135
139
if (!_rtc_pcf8523->begin (&Wire)) {
136
140
WS_DEBUG_PRINTLN (
137
141
" [SD] Runtime Error: Failed to initialize PCF8523 RTC on WIRE" );
142
+ #ifndef ARDUINO_ARCH_ESP8266
138
143
if (!_rtc_pcf8523->begin (&Wire1)) {
139
144
WS_DEBUG_PRINTLN (
140
145
" [SD] Runtime Error: Failed to initialize PCF8523 RTC on WIRE1" );
141
146
delete _rtc_pcf8523;
142
147
return false ;
143
148
}
149
+ #endif
144
150
}
145
151
if (!_rtc_pcf8523->initialized () || _rtc_pcf8523->lostPower ()) {
146
152
_rtc_pcf8523->adjust (DateTime (F (__DATE__), F (__TIME__)));
0 commit comments