I’m trying to run the ‘flash_png’ example from TFT_espi that’s supposed to display a png image of a panda, but am hitting a compilation error.
I’ve tried to include the compiler output below but I’m sorry, the formatting is messed up. I can try to provide any other info needed to diagnose this.
I have installed the pngDEC library.
As best I can tell the loop code is calling the function that draws each line of the image. It’s trying to cast the result as an int but the function is typed as void.
If I change the function type to int, I get one single line of the png rendering on the screen.
I haven’t modified anything so I’m wondering if this is perhaps a version incompatibility thing?
Using a inexpensive wroom esp32 and an st7796 driven tft screen in serial mode. The other examples I’ve tested thusfar (text, color, animations) have all worked fine.
Thank you for any ideas.
C:\Users\user\AppData\Local\Temp.arduinoIDE-unsaved2025918-26972-1ofbt04.c2xw\Flash_PNG\Flash_PNG.ino:55:63: error: invalid conversion from 'void ()(PNGDRAW)' {aka 'void ()(png_draw_tag)'} to 'int ()(PNGDRAW)' {aka 'int ()(png_draw_tag)'} [-fpermissive]
55 | int16_t rc = png.openFLASH((uint8_t *)panda, sizeof(panda), pngDraw);
| ^~~~~~~
| |
| void (*)(PNGDRAW*) {aka void (*)(png_draw_tag*)}
In file included from C:\Users\user\AppData\Local\Temp.arduinoIDE-unsaved2025918-26972-1ofbt04.c2xw\Flash_PNG\Flash_PNG.ino:20:
c:\Users\user\Documents\Arduino\libraries\PNGdec\src/PNGdec.h:174:69: note: initializing argument 3 of 'int PNG::openFLASH(uint8_t*, int, int ()(PNGDRAW))'
174 | int openFLASH(uint8_t *pData, int iDataSize, PNG_DRAW_CALLBACK *pfnDraw);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~
exit status 1
Compilation error: invalid conversion from 'void ()(PNGDRAW)' {aka 'void ()(png_draw_tag)'} to 'int ()(PNGDRAW)' {aka 'int ()(png_draw_tag)'} [-fpermissive]