Cardputer and drawJpgFile



  • Hello everybody.
    I have a problem that is giving me a headache. I purchased an M5Cardputer and I'm trying to get it to display a JPG image on the screen by reading from an SD card, using the M5Cardputer.Display.drawJpgFile function, but my code doesn't compile, returning this error.

    In file included from .pio/libdeps/m5stack-stamps3/M5GFX/src/M5GFX.h:22,
                     from .pio/libdeps/m5stack-stamps3/M5Unified/src/M5Unified.hpp:19,
                     from .pio/libdeps/m5stack-stamps3/M5Unified/src/M5Unified.h:5,
                     from .pio/libdeps/m5stack-stamps3/M5Cardputer/src/M5Cardputer.h:4,
                     from src/main.cpp:1:
    .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/LGFXBase.hpp: In instantiation of 'bool lgfx::v1::LGFXBase::drawJpgFile(T&, const char*, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, float, float, lgfx::v1::datum::datum_t) [with T = fs::SDFS; int32_
    t = int; lgfx::v1::datum::datum_t = lgfx::v1::textdatum::textdatum_t]':
    src/main.cpp:19:46:   required from here
    .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/LGFXBase.hpp:888:23: error: cannot declare variable 'file' to be of abstract type 'lgfx::v1::DataWrapperT<fs::SDFS>'
           DataWrapperT<T> file ( &fs ); \
                           ^~~~
    .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/LGFXBase.hpp:895:5: note: in expansion of macro 'LGFX_FUNCTION_GENERATOR'
         LGFX_FUNCTION_GENERATOR(drawJpg, draw_jpg)
         ^~~~~~~~~~~~~~~~~~~~~~~
    In file included from .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/platforms/esp32/../esp32/common.hpp:20,
                     from .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/platforms/esp32/../common.hpp:22,
                     from .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/platforms/esp32/Bus_SPI.hpp:57,
                     from .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/platforms/device.hpp:42,
                     from .pio/libdeps/m5stack-stamps3/M5GFX/src/M5GFX.h:19,
                     from .pio/libdeps/m5stack-stamps3/M5Unified/src/M5Unified.hpp:19,
                     from .pio/libdeps/m5stack-stamps3/M5Unified/src/M5Unified.h:5,
                     from .pio/libdeps/m5stack-stamps3/M5Cardputer/src/M5Cardputer.h:4,
                     from src/main.cpp:1:
    .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/platforms/esp32/../esp32/../../misc/DataWrapper.hpp:91:10: note:   because the following virtual functions are pure within 'lgfx::v1::DataWrapperT<fs::SDFS>':
       struct DataWrapperT : public DataWrapper {
              ^~~~~~~~~~~~
    .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/platforms/esp32/../esp32/../../misc/DataWrapper.hpp:72:17: note:         'virtual int lgfx::v1::DataWrapper::read(uint8_t*, uint32_t)'
         virtual int read(uint8_t *buf, uint32_t len) = 0;
                     ^~~~
    .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/platforms/esp32/../esp32/../../misc/DataWrapper.hpp:74:18: note:         'virtual void lgfx::v1::DataWrapper::skip(int32_t)'
         virtual void skip(int32_t offset) = 0;
                      ^~~~
    .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/platforms/esp32/../esp32/../../misc/DataWrapper.hpp:75:18: note:         'virtual bool lgfx::v1::DataWrapper::seek(uint32_t)'
         virtual bool seek(uint32_t offset) = 0;
                      ^~~~
    .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/platforms/esp32/../esp32/../../misc/DataWrapper.hpp:76:18: note:         'virtual void lgfx::v1::DataWrapper::close()'
         virtual void close(void) = 0;
                      ^~~~~
    .pio/libdeps/m5stack-stamps3/M5GFX/src/lgfx/v1/platforms/esp32/../esp32/../../misc/DataWrapper.hpp:77:21: note:         'virtual int32_t lgfx::v1::DataWrapper::tell()'
         virtual int32_t tell(void) = 0;
                         ^~~~
    *** [.pio/build/m5stack-stamps3/src/main.cpp.o] Error 1
    

    If possible, could anyone give me a code link or vidui, a tutorial that shows how to display it in a very simple way