Skip to content

Commit 24c3075

Browse files
committed
Add SD format warning
1 parent 3028e84 commit 24c3075

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

Firmware/RTK_Surveyor/Display.ino

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,3 +1040,29 @@ void drawFrame()
10401040
oled.line(0, yMax, xMax, yMax); //Bottom
10411041
oled.line(xMax, 0, xMax, yMax); //Right
10421042
}
1043+
1044+
//If the SD card is detected but is not formatted correctly, display warning
1045+
void displaySDFail()
1046+
{
1047+
if (online.display == true)
1048+
{
1049+
oled.clear(PAGE);
1050+
1051+
oled.setCursor(21, 13);
1052+
oled.setFontType(1);
1053+
1054+
int textX = 11;
1055+
int textY = 10;
1056+
int textKerning = 8;
1057+
1058+
printTextwithKerning("Format", textX, textY, textKerning);
1059+
1060+
textX = 7;
1061+
textY = 25;
1062+
textKerning = 8;
1063+
oled.setFontType(1);
1064+
1065+
printTextwithKerning("SD Card", textX, textY, textKerning);
1066+
oled.display();
1067+
}
1068+
}

Firmware/RTK_Surveyor/begin.ino

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ void beginSD()
5151

5252
if (createTestFile() == false)
5353
{
54-
Serial.println(F("Failed to create test file. Format with 'SD Card Formatter'."));
54+
Serial.println(F("Failed to create test file. Format SD card with 'SD Card Formatter'."));
55+
delay(5000);
5556
online.microSD = false;
5657
return;
5758
}
@@ -289,7 +290,7 @@ bool beginBluetooth()
289290
0, //Priority, with 3 (configMAX_PRIORITIES - 1) being the highest, and 0 being the lowest.
290291
&F9PSerialWriteTaskHandle); //Task handle
291292

292-
//Start task for controlling Bluetooth pair LED
293+
//Start task for controlling Bluetooth pair LED
293294
btLEDTask.attach(btLEDTaskPace, updateBTled); //Rate in seconds, callback
294295

295296
return (true);

0 commit comments

Comments
 (0)