Skip to content

Commit 49ce1b2

Browse files
committed
Fix bad logic on SD quick test
1 parent 080b830 commit 49ce1b2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Firmware/RTK_Surveyor/Begin.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,15 @@ void beginSD()
171171
//Do a quick test to see if a card is present
172172
int tries = 0;
173173
int maxTries = 5;
174-
while (tries++ < maxTries)
174+
while (tries < maxTries)
175175
{
176176
if (sdPresent() == true) break;
177177
log_d("SD present failed. Trying again %d out of %d", tries + 1, maxTries);
178178

179179
//Max power up time is 250ms: https://www.kingston.com/datasheets/SDCIT-specsheet-64gb_en.pdf
180180
//Max current is 200mA average across 1s, peak 300mA
181181
delay(10);
182+
tries++;
182183
}
183184
if (tries == maxTries) return;
184185

0 commit comments

Comments
 (0)