Skip to content

Commit f70f9ae

Browse files
committed
Fix ESp8266 compile completely
1 parent 79f6042 commit f70f9ae

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/provisioning/littlefs/WipperSnapper_LittleFS.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,11 @@ void WipperSnapper_LittleFS::fsHalt(String msg, ws_led_status_t status_state) {
162162
/**************************************************************************/
163163
void WipperSnapper_LittleFS::GetSDCSPin() {
164164
// Attempt to open and deserialize the config.json file
165+
#if defined(ARDUINO_ESP8266_ADAFRUIT_HUZZAH)
166+
File file_cfg = LittleFS.open("/config.json", "r");
167+
#else
165168
File file_cfg = LittleFS.open("/config.json");
169+
#endif
166170
if (!file_cfg)
167171
WsV2.pin_sd_cs = 255;
168172

src/provisioning/sdcard/ws_sdcard.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,13 @@ void ws_sdcard::calculateFileLimits() {
9090
bool ws_sdcard::InitDS1307() {
9191
_rtc_ds1307 = new RTC_DS1307();
9292
if (!_rtc_ds1307->begin()) {
93+
#ifndef ARDUINO_ARCH_ESP8266
9394
if (!_rtc_ds1307->begin(&Wire1)) {
9495
WS_DEBUG_PRINTLN("[SD] Runtime Error: Failed to initialize DS1307 RTC");
9596
delete _rtc_ds1307;
9697
return false;
9798
}
99+
#endif
98100
}
99101
if (!_rtc_ds1307->isrunning())
100102
_rtc_ds1307->adjust(DateTime(F(__DATE__), F(__TIME__)));
@@ -112,11 +114,13 @@ bool ws_sdcard::InitDS3231() {
112114
WS_DEBUG_PRINTLN("Begin DS3231 init");
113115
_rtc_ds3231 = new RTC_DS3231();
114116
if (!_rtc_ds3231->begin(&Wire)) {
117+
#ifndef ARDUINO_ARCH_ESP8266
115118
if (!_rtc_ds3231->begin(&Wire1)) {
116119
WS_DEBUG_PRINTLN("[SD] Runtime Error: Failed to initialize DS3231 RTC");
117120
delete _rtc_ds3231;
118121
return false;
119122
}
123+
#endif
120124
}
121125
if (_rtc_ds3231->lostPower())
122126
_rtc_ds3231->adjust(DateTime(F(__DATE__), F(__TIME__)));
@@ -135,12 +139,14 @@ bool ws_sdcard::InitPCF8523() {
135139
if (!_rtc_pcf8523->begin(&Wire)) {
136140
WS_DEBUG_PRINTLN(
137141
"[SD] Runtime Error: Failed to initialize PCF8523 RTC on WIRE");
142+
#ifndef ARDUINO_ARCH_ESP8266
138143
if (!_rtc_pcf8523->begin(&Wire1)) {
139144
WS_DEBUG_PRINTLN(
140145
"[SD] Runtime Error: Failed to initialize PCF8523 RTC on WIRE1");
141146
delete _rtc_pcf8523;
142147
return false;
143148
}
149+
#endif
144150
}
145151
if (!_rtc_pcf8523->initialized() || _rtc_pcf8523->lostPower()) {
146152
_rtc_pcf8523->adjust(DateTime(F(__DATE__), F(__TIME__)));

0 commit comments

Comments
 (0)