Skip to content

Commit 6801bbe

Browse files
authored
Merge pull request #132 from sparkfun/release_candidate
v2.3 Revisited - disable unnecessary debug prints
2 parents 7c3b6a3 + 1730ffc commit 6801bbe

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

Binaries/OpenLog_Artemis-V10-v23.bin

72 Bytes
Binary file not shown.

Binaries/OpenLog_Artemis-X04-v23.bin

72 Bytes
Binary file not shown.

Firmware/OpenLog_Artemis/OpenLog_Artemis.ino

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

Firmware/OpenLog_Artemis/lowerPower.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ void wakeFromSleep()
505505

506506
SPI.begin(); //Needed if SD is disabled
507507

508-
beginSD(); //285 - 293ms
508+
beginSD(true); //285 - 293ms
509509

510510
enableCIPOpullUp(); // Enable CIPO pull-up _after_ beginSD
511511

@@ -517,7 +517,7 @@ void wakeFromSleep()
517517
beginSerialOutput();
518518
}
519519

520-
beginIMU(); //61ms
520+
beginIMU(true); //61ms
521521
printDebug("wakeFromSleep: online.IMU = " + (String)online.IMU + "\r\n");
522522

523523
//If we powered down the Qwiic bus, then re-begin and re-configure everything

0 commit comments

Comments
 (0)