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 =
8282
8383; Common build environment for ESP32 platform
8484[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
8787platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.07/platform-espressif32.zip
8888lib_ignore = WiFiNINA, WiFi101
8989monitor_filters = esp32_exception_decoder, time
Original file line number Diff line number Diff line change @@ -97,18 +97,20 @@ void Wippersnapper_V2::provisionV2() {
9797 // Initialize the status LED for signaling FS errors
9898 initStatusLED ();
9999
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-
105100// Initialize the filesystem
106101#ifdef USE_TINYUSB
107102 _fileSystemV2 = new Wippersnapper_FS_V2 ();
108103#elif defined(USE_LITTLEFS)
109104 _littleFSV2 = new WipperSnapper_LittleFS ();
110105#endif
111106
107+ if (WsV2._sdCardV2 ->initSDCard ()) {
108+ setStatusLEDColor (GREEN);
109+ return ;
110+ } else {
111+ setStatusLEDColor (RED);
112+ }
113+
112114#ifdef USE_DISPLAY
113115 // Initialize the display
114116 displayConfig config;
@@ -1168,8 +1170,8 @@ void printDeviceInfoV2() {
11681170*/
11691171/* *************************************************************************/
11701172void Wippersnapper_V2::connectV2 () {
1173+ setStatusLEDColor (BLUE);
11711174 WS_DEBUG_PRINTLN (" Adafruit.io WipperSnapper" );
1172-
11731175 // Dump device info to the serial monitor
11741176 printDeviceInfoV2 ();
11751177
Original file line number Diff line number Diff line change @@ -30,12 +30,11 @@ void setup() {
3030 manager.provision ();
3131
3232 Serial.begin (115200 );
33- while (!Serial) {;}
33+ while (!Serial) delay ( 10 );
3434 Serial.println (" Adafruit Wippersnapper API Manager Demo" );
3535 Serial.print (" Running Wippersnapper API Version: " );
3636 Serial.println (manager.getAPIVersion ());
3737 manager.connect ();
38-
3938}
4039
4140void loop () {
Original file line number Diff line number Diff line change 2222ws_sdcard::ws_sdcard () {
2323 mode_offline = false ;
2424 _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-
3525}
3626
3727/* *************************************************************************/
@@ -48,6 +38,16 @@ ws_sdcard::~ws_sdcard() {
4838 }
4939}
5040
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+
5151/* *************************************************************************/
5252/* !
5353 @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 {
3232public:
3333 ws_sdcard ();
3434 ~ws_sdcard ();
35+ bool initSDCard ();
3536 void EnableLogging ();
3637 bool parseConfigFile ();
3738 bool waitForSerialConfig ();
You can’t perform that action at this time.
0 commit comments