m5stack / M5EPD

M5Paper Arduino Library
MIT License
167 stars 53 forks source link

M5EPD_Canvas::setDriver does not initialise correctly #19

Closed murraypaul closed 9 months ago

murraypaul commented 3 years ago

M5EPD_Canvas::M5EPD_Canvas(M5EPD_Driver *driver) set _bpp to 4, overriding the default value of 16 from TFT_eSprite.

Neither M5EPD_Canvas::M5EPD_Canvas() nor M5EPD_Canvas::setDriver set _bpp.

(They also do not set _bytewidth, _last_push_x or _last_push_y, leaving them uninitialised.)

That means that

M5EPD_Canvas Canvas;
Canvas.setDriver(&M5.EPD);

Does not work in the same way that

M5EPD_Canvas Canvas(&M5.EPD);

Does.

murraypaul commented 3 years ago

Pull request: #20