@@ -30,15 +30,15 @@ SOFTWARE.
3030 #include " SD_MMC.h"
3131
3232 #define _BB_SDFS SD_MMC
33- #define _BB_SETUP_STR " BB: BB_USE_SDMMC"
33+ #define _BB_SETUP_STR " BB: BB_USE_SDMMC"
3434
3535#else
3636
3737 #include " SPI.h"
3838 #include " SD.h"
3939
4040 #define _BB_SDFS SD
41- #define _BB_SETUP_STR " BB: BB_USE_SD"
41+ #define _BB_SETUP_STR " BB: BB_USE_SD"
4242 extern SPIClass *bb_spi;
4343
4444#endif
@@ -70,14 +70,14 @@ class BBFS_SD : public BBFS {
7070
7171 sd_logOpen (BB_LOG_DIR_NAME);
7272 if (file) {
73- Serial.printf (" BB: start OK - attempt=%d file=%s\n " , attempt, filename.c_str ());
73+ Serial.printf (" BB: start OK - attempt=%d file=%s\n " , attempt, filename.c_str ());
7474 return true ;
7575 }
7676 }
7777
7878 setup_done = false ; // force setup to re-run
7979 }
80- Serial.println (" BB: start FAILED" );
80+ Serial.println (" BB: start FAILED" );
8181 return false ;
8282 }
8383
@@ -135,13 +135,13 @@ class BBFS_SD : public BBFS {
135135
136136 buf = (uint8_t *)malloc (512 );
137137 if (!buf) {
138- Serial.println (" BB: bench - malloc failed" );
138+ Serial.println (" BB: bench - malloc failed" );
139139 return ;
140140 }
141141
142142 file = _BB_SDFS.open (path, FILE_WRITE);
143143 if (!file){
144- Serial.println (" BB: bench - Failed to open file for writing" );
144+ Serial.println (" BB: bench - Failed to open file for writing" );
145145 free (buf);
146146 return ;
147147 }
@@ -156,12 +156,12 @@ class BBFS_SD : public BBFS {
156156 }
157157 end = millis () - start;
158158 flen = 2048 * 512 ;
159- Serial.printf (" BB: %s %u bytes written in %u ms %f kbps\r\n " , path, (int )flen, (int )end, (float )flen/end);
159+ Serial.printf (" BB: %s %u bytes written in %u ms %f kbps\r\n " , path, (int )flen, (int )end, (float )flen/end);
160160 file.close ();
161161
162162 file = _BB_SDFS.open (path);
163163 if (!file){
164- Serial.println (" BB: bench - Failed to open file for reading" );
164+ Serial.println (" BB: bench - Failed to open file for reading" );
165165 free (buf);
166166 return ;
167167 }
@@ -177,7 +177,7 @@ class BBFS_SD : public BBFS {
177177 len -= toRead;
178178 }
179179 end = millis () - start;
180- Serial.printf (" BB: %s %u bytes read in %u ms %f kbps\r\n " , path, (int )flen, (int )end, (float )flen/end);
180+ Serial.printf (" BB: %s %u bytes read in %u ms %f kbps\r\n " , path, (int )flen, (int )end, (float )flen/end);
181181 file.close ();
182182
183183 free (buf);
@@ -217,20 +217,20 @@ class BBFS_SD : public BBFS {
217217 #if BB_USE == BB_USE_SDMMC
218218 _BB_SDFS.setPins (HW_PIN_SDMMC_CLK, HW_PIN_SDMMC_CMD, HW_PIN_SDMMC_DATA);
219219 if (!_BB_SDFS.begin (" /sdcard" , true , true , SDMMC_FREQ_DEFAULT, 5 )) {
220- Serial.println (" BB_USE_SDMMC Card Mount Failed" );
220+ Serial.println (" BB: BB_USE_SDMMC Card Mount Failed" );
221221 return setup_done;
222222 }
223223 #else
224224 bb_spi->begin (HW_PIN_SPI2_SCLK, HW_PIN_SPI2_MISO, HW_PIN_SPI2_MOSI, HW_PIN_BB_CS);
225225 if (!_BB_SDFS.begin (HW_PIN_BB_CS, *bb_spi)) {
226- Serial.println (" BB_USE_SD Card Mount Failed" );
226+ Serial.println (" BB: BB_USE_SD Card Mount Failed" );
227227 return setup_done;
228228 }
229229 #endif
230230
231231 uint8_t cardType = _BB_SDFS.cardType ();
232232 if (cardType == CARD_NONE){
233- Serial.println (" BB: No SD card attached" );
233+ Serial.println (" BB: No SD card attached" );
234234 return setup_done;
235235 }
236236
@@ -284,17 +284,17 @@ class BBFS_SD : public BBFS {
284284 File root = _BB_SDFS.open (dirname);
285285 if (!root){
286286 if (!_BB_SDFS.mkdir (dirname)){
287- Serial.println (" BB: mkdir /log failed" );
287+ Serial.println (" BB: mkdir /log failed" );
288288 return ;
289289 }
290290 root = _BB_SDFS.open (dirname);
291291 if (!root) {
292- Serial.println (" BB: mkdir /log failed" );
292+ Serial.println (" BB: mkdir /log failed" );
293293 return ;
294294 }
295295 }
296296 if (!root.isDirectory ()){
297- Serial.println (" BB: /log is not a directory" );
297+ Serial.println (" BB: /log is not a directory" );
298298 return ;
299299 }
300300
0 commit comments