File tree Expand file tree Collapse file tree 5 files changed +22
-20
lines changed Expand file tree Collapse file tree 5 files changed +22
-20
lines changed Original file line number Diff line number Diff line change @@ -82,8 +82,8 @@ lib_deps =
82
82
83
83
; Common build environment for ESP32 platform
84
84
[common:esp32]
85
- ; platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.03/platform-espressif32.zip
86
- ; platform = https://github.com/pioarduino/platform-espressif32#develop
85
+ ; platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.03/platform-espressif32.zip
86
+ ; platform = https://github.com/pioarduino/platform-espressif32#develop
87
87
platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip
88
88
lib_ignore = WiFiNINA, WiFi101
89
89
monitor_filters = esp32_exception_decoder, time
Original file line number Diff line number Diff line change @@ -97,18 +97,20 @@ void Wippersnapper_V2::provisionV2() {
97
97
// Initialize the status LED for signaling FS errors
98
98
initStatusLED ();
99
99
100
- // If an SD card is inserted and mounted, we do not need to provision
101
- // wifi/io credentials
102
- if (WsV2._sdCardV2 ->mode_offline == true )
103
- return ;
104
-
105
100
// Initialize the filesystem
106
101
#ifdef USE_TINYUSB
107
102
_fileSystemV2 = new Wippersnapper_FS_V2 ();
108
103
#elif defined(USE_LITTLEFS)
109
104
_littleFSV2 = new WipperSnapper_LittleFS ();
110
105
#endif
111
106
107
+ if (WsV2._sdCardV2 ->initSDCard ()) {
108
+ setStatusLEDColor (GREEN);
109
+ return ;
110
+ } else {
111
+ setStatusLEDColor (RED);
112
+ }
113
+
112
114
#ifdef USE_DISPLAY
113
115
// Initialize the display
114
116
displayConfig config;
@@ -1168,8 +1170,8 @@ void printDeviceInfoV2() {
1168
1170
*/
1169
1171
/* *************************************************************************/
1170
1172
void Wippersnapper_V2::connectV2 () {
1173
+ setStatusLEDColor (BLUE);
1171
1174
WS_DEBUG_PRINTLN (" Adafruit.io WipperSnapper" );
1172
-
1173
1175
// Dump device info to the serial monitor
1174
1176
printDeviceInfoV2 ();
1175
1177
Original file line number Diff line number Diff line change @@ -30,12 +30,11 @@ void setup() {
30
30
manager.provision ();
31
31
32
32
Serial.begin (115200 );
33
- while (!Serial) {;}
33
+ while (!Serial) delay ( 10 );
34
34
Serial.println (" Adafruit Wippersnapper API Manager Demo" );
35
35
Serial.print (" Running Wippersnapper API Version: " );
36
36
Serial.println (manager.getAPIVersion ());
37
37
manager.connect ();
38
-
39
38
}
40
39
41
40
void loop () {
Original file line number Diff line number Diff line change 22
22
ws_sdcard::ws_sdcard () {
23
23
mode_offline = false ;
24
24
_wokwi_runner = false ;
25
- /* #ifndef SD_CS_PIN
26
- return;
27
- #else
28
- // Attempt to initialize the SD card
29
- if (_sd.begin(SD_CS_PIN)) {
30
- mode_offline = true;
31
- }
32
- #endif
33
- */
34
-
35
25
}
36
26
37
27
/* *************************************************************************/
@@ -48,6 +38,16 @@ ws_sdcard::~ws_sdcard() {
48
38
}
49
39
}
50
40
41
+ bool ws_sdcard::initSDCard () {
42
+ #ifdef SD_CS_PIN
43
+ // Attempt to initialize the SD card
44
+ if (_sd.begin (SD_CS_PIN)) {
45
+ mode_offline = true ;
46
+ }
47
+ #endif
48
+ return mode_offline;
49
+ }
50
+
51
51
/* *************************************************************************/
52
52
/* !
53
53
@brief Enables logging via a physical RTC to a SD-card, if available.
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class ws_sdcard {
32
32
public:
33
33
ws_sdcard ();
34
34
~ws_sdcard ();
35
+ bool initSDCard ();
35
36
void EnableLogging ();
36
37
bool parseConfigFile ();
37
38
bool waitForSerialConfig ();
You can’t perform that action at this time.
0 commit comments