@@ -202,6 +202,10 @@ enum returnStatus {
202202  STATUS_PRESSED_X,
203203};
204204
205+ // Header
206+ void  beginSD (bool  silent = false );
207+ void  beginIMU (bool  silent = false );
208+ 
205209// Setup Qwiic Port
206210// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
207211#include  < Wire.h> 
@@ -908,7 +912,7 @@ void setQwiicPullups(uint32_t qwiicBusPullUps)
908912  pin_config (PinName (PIN_QWIIC_SDA), sdaPinCfg);
909913}
910914
911- void  beginSD ()
915+ void  beginSD (bool  silent )
912916{
913917  pinMode (PIN_MICROSD_POWER, OUTPUT);
914918  pin_config (PinName (PIN_MICROSD_POWER), g_AM_HAL_GPIO_OUTPUT); //  Make sure the pin does actually get re-configured
@@ -944,8 +948,11 @@ void beginSD()
944948    }
945949    if  (sd.begin (SD_CONFIG) == false ) //  Try to begin the SD card using the correct chip select
946950    {
947-       SerialPrintln (F (" SD init failed (second attempt). Is card present? Formatted?"  ));
948-       SerialPrintln (F (" Please ensure the SD card is formatted correctly using https://www.sdcard.org/downloads/formatter/"  ));
951+       if  (!silent)
952+       {
953+         SerialPrintln (F (" SD init failed (second attempt). Is card present? Formatted?"  ));
954+         SerialPrintln (F (" Please ensure the SD card is formatted correctly using https://www.sdcard.org/downloads/formatter/"  ));
955+       }
949956      digitalWrite (PIN_MICROSD_CHIP_SELECT, HIGH); // Be sure SD is deselected
950957      online.microSD  = false ;
951958      return ;
@@ -955,7 +962,10 @@ void beginSD()
955962  // Change to root directory. All new file creation will be in root.
956963  if  (sd.chdir () == false )
957964  {
958-     SerialPrintln (F (" SD change directory failed"  ));
965+     if  (!silent)
966+     {
967+       SerialPrintln (F (" SD change directory failed"  ));
968+     }
959969    online.microSD  = false ;
960970    return ;
961971  }
@@ -988,7 +998,7 @@ void configureSerial1TxRx(void) // Configure pins 12 and 13 for UART1 TX and RX
988998  pin_config (PinName (BREAKOUT_PIN_RX), pinConfigRx);
989999}
9901000
991- void  beginIMU ()
1001+ void  beginIMU (bool  silent )
9921002{
9931003  pinMode (PIN_IMU_POWER, OUTPUT);
9941004  pin_config (PinName (PIN_IMU_POWER), g_AM_HAL_GPIO_OUTPUT); //  Make sure the pin does actually get re-configured
@@ -1038,7 +1048,8 @@ void beginIMU()
10381048      {
10391049        printDebug (" beginIMU: second attempt at myICM.begin failed. myICM.status = "   + (String)myICM.status  + " \r\n "  );
10401050        digitalWrite (PIN_IMU_CHIP_SELECT, HIGH); // Be sure IMU is deselected
1041-         // SerialPrintln(F("ICM-20948 failed to init."));
1051+         if  (!silent)
1052+           SerialPrintln (F (" ICM-20948 failed to init."  ));
10421053        imuPowerOff ();
10431054        online.IMU  = false ;
10441055        return ;
0 commit comments