Fix M5Stack compilation issues
Include change to display global M5.Lcd (issue
Fix missing return values
@@ -54,8 +54,8 @@ extern "C" {
// ------------------------------------------------------------------------
-// Use default pin settings as defined in M5Stack/src/utility/Display.h
-ILI9341 m_disp = ILI9341();
+// Use default pin settings as defined in M5Stack/src/utility/Config.h
+#define m_disp m5.Lcd
// =======================================================================
// Public APIs to GUIslice core library
@@ -125,6 +125,9 @@ void* gslc_DrvLoadImage(gslc_tsGui* pGui,gslc_tsImgRef sImgRef)
} else if ((sImgRef.eImgFlags & GSLC_IMGREF_SRC) == GSLC_IMGREF_SRC_PROG) {
return NULL; // No image preload done
}
+
+ // Default
+ return NULL;
}
@@ -280,6 +283,9 @@ bool gslc_DrvDrawTxtAlign(gslc_tsGui* pGui,int16_t nX0,int16_t nY0,int16_t nX1,i
m_disp.setTextDatum(nDatum);
m_disp.drawString(pStr,nTxtX,nTxtY);
+
+ // For now, always return true
+ return true;
}
// NOTE: As TFT_eSPI performs some complex logic in determining the font
@@ -481,7 +487,7 @@ void gslc_DrvDrawMonoFromMem(gslc_tsGui* pGui,int16_t nDstX, int16_t nDstY,
bmap_base++;
int16_t i, j, byteWidth = (w + 7) / 8;
- uint8_t nByte;
+ uint8_t nByte = 0;
for(j=0; j<h; j++) {
for(i=0; i<w; i++) {
