Prevent SD card error causing boot loop
This commit is contained in:
parent
1107590b56
commit
fc37cb425d
19
src/main.cpp
19
src/main.cpp
@ -158,6 +158,15 @@ void onGoHome() {
|
|||||||
enterNewActivity(new HomeActivity(renderer, inputManager, onGoToReaderHome, onGoToSettings, onGoToFileTransfer));
|
enterNewActivity(new HomeActivity(renderer, inputManager, onGoToReaderHome, onGoToSettings, onGoToFileTransfer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setupDisplayAndFonts() {
|
||||||
|
einkDisplay.begin();
|
||||||
|
Serial.printf("[%lu] [ ] Display initialized\n", millis());
|
||||||
|
renderer.insertFont(READER_FONT_ID, bookerlyFontFamily);
|
||||||
|
renderer.insertFont(UI_FONT_ID, ubuntuFontFamily);
|
||||||
|
renderer.insertFont(SMALL_FONT_ID, smallFontFamily);
|
||||||
|
Serial.printf("[%lu] [ ] Fonts setup\n", millis());
|
||||||
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
t1 = millis();
|
t1 = millis();
|
||||||
|
|
||||||
@ -179,6 +188,7 @@ void setup() {
|
|||||||
// SD Card Initialization
|
// SD Card Initialization
|
||||||
if (!SD.begin(SD_SPI_CS, SPI, SPI_FQ)) {
|
if (!SD.begin(SD_SPI_CS, SPI, SPI_FQ)) {
|
||||||
Serial.printf("[%lu] [ ] SD card initialization failed\n", millis());
|
Serial.printf("[%lu] [ ] SD card initialization failed\n", millis());
|
||||||
|
setupDisplayAndFonts();
|
||||||
exitActivity();
|
exitActivity();
|
||||||
enterNewActivity(new FullScreenMessageActivity(renderer, inputManager, "SD card error", BOLD));
|
enterNewActivity(new FullScreenMessageActivity(renderer, inputManager, "SD card error", BOLD));
|
||||||
return;
|
return;
|
||||||
@ -189,14 +199,7 @@ void setup() {
|
|||||||
// verify power button press duration after we've read settings.
|
// verify power button press duration after we've read settings.
|
||||||
verifyWakeupLongPress();
|
verifyWakeupLongPress();
|
||||||
|
|
||||||
// Initialize display
|
setupDisplayAndFonts();
|
||||||
einkDisplay.begin();
|
|
||||||
Serial.printf("[%lu] [ ] Display initialized\n", millis());
|
|
||||||
|
|
||||||
renderer.insertFont(READER_FONT_ID, bookerlyFontFamily);
|
|
||||||
renderer.insertFont(UI_FONT_ID, ubuntuFontFamily);
|
|
||||||
renderer.insertFont(SMALL_FONT_ID, smallFontFamily);
|
|
||||||
Serial.printf("[%lu] [ ] Fonts setup\n", millis());
|
|
||||||
|
|
||||||
exitActivity();
|
exitActivity();
|
||||||
enterNewActivity(new BootActivity(renderer, inputManager));
|
enterNewActivity(new BootActivity(renderer, inputManager));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user