Skip to content

Commit a3a49d7

Browse files
committed
wifi: print debug errors only if Serial is up
1 parent 3305d59 commit a3a49d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libraries/WiFi/src/WiFi.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ bool firmware_available = false;
253253
#include "resources.h"
254254

255255
void wiced_filesystem_mount_error(void) {
256+
while (!Serial) {}
256257
Serial.println("Failed to mount the filesystem containing the WiFi firmware.");
257258
Serial.println("Usually that means that the WiFi firmware has not been installed yet"
258259
" or was overwritten with another firmware.");
@@ -261,6 +262,7 @@ void wiced_filesystem_mount_error(void) {
261262
}
262263

263264
void wiced_filesystem_firmware_error(void) {
265+
while (!Serial) {}
264266
Serial.println("Please run the \"WiFiFirmwareUpdater\" sketch once to install the WiFi firmware.");
265267
whd_print_logbuffer();
266268
while (1) {}
@@ -283,7 +285,7 @@ wiced_result_t whd_firmware_check_hook(const char* mounted_name, int mount_err)
283285
return WICED_SUCCESS;
284286
}
285287
}
286-
Serial.println("File not found");
288+
if (Serial) { Serial.println("File not found\n"); }
287289
closedir(dir);
288290
}
289291
wiced_filesystem_firmware_error();

0 commit comments

Comments
 (0)