Commit d12a68a4 authored by Bodmer's avatar Bodmer

Add checks in examples for missing font files

parent 2ba492c1
...@@ -59,6 +59,18 @@ void setup(void) { ...@@ -59,6 +59,18 @@ void setup(void) {
while (1) yield(); // Stay here twiddling thumbs waiting while (1) yield(); // Stay here twiddling thumbs waiting
} }
Serial.println("\r\nSPIFFS available!"); Serial.println("\r\nSPIFFS available!");
// ESP32 will crash if any of the fonts are missing
bool font_missing = false;
if (SPIFFS.exists("/NotoSansBold15.vlw") == false) font_missing = true;
if (SPIFFS.exists("/NotoSansBold36.vlw") == false) font_missing = true;
if (font_missing)
{
Serial.println("\r\nFont missing in SPIFFS, did you upload it?");
while(1) yield();
}
else Serial.println("\r\nFonts found OK.");
} }
......
...@@ -53,6 +53,18 @@ void setup(void) { ...@@ -53,6 +53,18 @@ void setup(void) {
while (1) yield(); // Stay here twiddling thumbs waiting while (1) yield(); // Stay here twiddling thumbs waiting
} }
Serial.println("\r\nSPIFFS available!"); Serial.println("\r\nSPIFFS available!");
// ESP32 will crash if any of the fonts are missing
bool font_missing = false;
if (SPIFFS.exists("/NotoSansBold15.vlw") == false) font_missing = true;
if (SPIFFS.exists("/NotoSansBold36.vlw") == false) font_missing = true;
if (font_missing)
{
Serial.println("\r\nFont missing in SPIFFS, did you upload it?");
while(1) yield();
}
else Serial.println("\r\nFonts found OK.");
} }
void loop() { void loop() {
......
...@@ -57,6 +57,19 @@ void setup(void) { ...@@ -57,6 +57,19 @@ void setup(void) {
while (1) yield(); // Stay here twiddling thumbs waiting while (1) yield(); // Stay here twiddling thumbs waiting
} }
Serial.println("\r\nSPIFFS available!"); Serial.println("\r\nSPIFFS available!");
// ESP32 will crash if any of the fonts are missing
bool font_missing = false;
if (SPIFFS.exists("/NotoSansBold15.vlw") == false) font_missing = true;
if (SPIFFS.exists("/NotoSansBold36.vlw") == false) font_missing = true;
if (SPIFFS.exists("/NotoSansMonoSCB20.vlw") == false) font_missing = true;
if (font_missing)
{
Serial.println("\r\nFont missing in SPIFFS, did you upload it?");
while(1) yield();
}
else Serial.println("\r\nFonts found OK.");
} }
void loop() { void loop() {
......
...@@ -68,6 +68,18 @@ void setup(void) { ...@@ -68,6 +68,18 @@ void setup(void) {
while (1) yield(); // Stay here twiddling thumbs waiting while (1) yield(); // Stay here twiddling thumbs waiting
} }
Serial.println("\r\nSPIFFS available!"); Serial.println("\r\nSPIFFS available!");
// ESP32 will crash if any of the fonts are missing
bool font_missing = false;
if (SPIFFS.exists("/NotoSansBold15.vlw") == false) font_missing = true;
if (SPIFFS.exists("/NotoSansBold36.vlw") == false) font_missing = true;
if (font_missing)
{
Serial.println("\r\nFont missing in SPIFFS, did you upload it?");
while(1) yield();
}
else Serial.println("\r\nFonts found OK.");
} }
void loop() { void loop() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment