mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-10 08:04:43 +02:00
Add checks in examples for missing font files
This commit is contained in:
@@ -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) {
|
|||||||
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) {
|
|||||||
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) {
|
|||||||
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() {
|
||||||
|
Reference in New Issue
Block a user