Skip to content

Commit a5cd783

Browse files
committed
Reduce the number of SD tries. Only print if SD was started.
Fix for #679
1 parent e7eb95f commit a5cd783

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ void beginSD()
384384

385385
// Do a quick test to see if a card is present
386386
int tries = 0;
387-
int maxTries = 5;
387+
int maxTries = 2;
388388
while (tries < maxTries)
389389
{
390390
if (sdPresent() == true)
@@ -397,7 +397,10 @@ void beginSD()
397397
tries++;
398398
}
399399
if (tries == maxTries)
400+
{
401+
log_d("sdPresent failed");
400402
break; // Give up loop
403+
}
401404

402405
// If an SD card is present, allow SdFat to take over
403406
log_d("SD card detected - using SPI and SdFat");

Firmware/RTK_Surveyor/SD.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
// within a reasonable amount of time, there is no SD card on the bus.
3838
// Returns false if not card is detected
3939
// Returns true if a card responds
40+
// This test takes approximately 13ms to complete
4041
bool sdPresent(void)
4142
{
4243
if (productVariant == REFERENCE_STATION)

0 commit comments

Comments
 (0)