added error msg for when GSLC_SPIFFS_EN!=1
MODIFY
src/GUIslice_drv_tft_espi.cpp
src/GUIslice_drv_tft_espi.cpp
@@ -207,7 +207,6 @@ bool gslc_DrvInit(gslc_tsGui* pGui)
GSLC_DEBUG_PRINT("ERROR: DrvInit() SD init failed\n", 0);
return false;
}
-// GSLC_DEBUG_PRINT("- Init SD File System OK\n", 0);
#endif
#if (GSLC_SPIFFS_EN)
@@ -215,7 +214,6 @@ bool gslc_DrvInit(gslc_tsGui* pGui)
if (!SPIFFS.begin()) {
GSLC_DEBUG_PRINT("ERROR: DrvInit() SPIFFS init failed\n", 0);
}
-// GSLC_DEBUG_PRINT("- Init SPIFFS File System OK\n", 0);
#endif
}
return true;
@@ -960,8 +958,9 @@ bool gslc_DrvDrawImage(gslc_tsGui* pGui,int16_t nDstX,int16_t nDstY,gslc_tsImgRe
if (sImgRef.eImgFlags == GSLC_IMGREF_NONE) {
return true; // Nothing to do
-#if (GSLC_SPIFFS_EN)
} else if ((sImgRef.eImgFlags & GSLC_IMGREF_SRC) == GSLC_IMGREF_SRC_FILE) {
+ // Load image from SPIFFS
+ #if (GSLC_SPIFFS_EN)
if ((sImgRef.eImgFlags & GSLC_IMGREF_FMT) == GSLC_IMGREF_FMT_JPG) {
// Draw Jpeg from SPIFFS file system
gslc_DrvDrawJpegFromFile(pGui,nDstX,nDstY,sImgRef);
@@ -973,6 +972,9 @@ bool gslc_DrvDrawImage(gslc_tsGui* pGui,int16_t nDstX,int16_t nDstY,gslc_tsImgRe
} else {
return false; // TODO: not yet supported
}
+ #else
+ GSLC_DEBUG_PRINT("ERROR: GetImageFromSD() not supported as Config:GSLC_SPIFFS_EN=0", 0);
+ return false; // TODO: not yet supported
#endif // end GSLC_SPIFFS_EN
} else if ((sImgRef.eImgFlags & GSLC_IMGREF_SRC) == GSLC_IMGREF_SRC_RAM) {
if ((sImgRef.eImgFlags & GSLC_IMGREF_FMT) == GSLC_IMGREF_FMT_RAW1) {
@@ -1017,12 +1019,13 @@ bool gslc_DrvDrawImage(gslc_tsGui* pGui,int16_t nDstX,int16_t nDstY,gslc_tsImgRe
}
#else
// SD card access not enabled
+ GSLC_DEBUG_PRINT("ERROR: GSLC_SD_EN must be set to 1 to access SD Card\n", 0);
return false;
#endif
} else {
// Unsupported source
- GSLC_DEBUG2_PRINT("DBG: DrvDrawImage() unsupported source eImgFlags=%d\n", sImgRef.eImgFlags);
+ GSLC_DEBUG_PRINT("DBG: DrvDrawImage() unsupported source eImgFlags=%d\n", sImgRef.eImgFlags);
return false;
}
}
@@ -1042,8 +1045,7 @@ bool gslc_DrvDrawJpegFromFile(gslc_tsGui* pGui,int16_t nDstX,int16_t nDstY,gslc_
{
const char* pStrFname = sImgRef.pFname;
- // Load Jpeg image from SPIFFS file system
-
+ // Load Jpeg image from file system
#if defined(ESP32)
// use optimized ESP32 native decoder
fex.drawJpgFile(SPIFFS, pStrFname, nDstX, nDstY);

added error msg for when GSLC_SPIFFS_EN!=1