Skip to content

Commit 34e047d

Browse files
committed
Prevent SPI scanning if SD card fails to mount
Fix #758
1 parent 0e09e34 commit 34e047d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,9 @@ void beginBoard()
363363

364364
void beginSD()
365365
{
366+
if(sdCardForcedOffline == true)
367+
return;
368+
366369
bool gotSemaphore;
367370

368371
online.microSD = false;
@@ -447,6 +450,8 @@ void beginSD()
447450
systemPrintln("SD init failed - using SPI and SdFat. Is card formatted?");
448451
digitalWrite(pin_microSD_CS, HIGH); // Be sure SD is deselected
449452

453+
sdCardForcedOffline = true; //Prevent future scans for SD cards
454+
450455
// Check reset count and prevent rolling reboot
451456
if (settings.resetCount < 5)
452457
{

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,9 @@ unsigned long shutdownNoChargeTimer = 0;
720720

721721
RtkMode_t rtkMode; // Mode of operation
722722

723+
bool sdCardForcedOffline = false; //Goes true if a isPresent() test passes, but then sdFat fails to mount SD card.
724+
//See issue: https://github.com/sparkfun/SparkFun_RTK_Firmware/issues/758
725+
723726
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
724727

725728
#define DEAD_MAN_WALKING_ENABLED 0

0 commit comments

Comments
 (0)