Closed PaulN8 closed 2 years ago
Update: Perhaps not surprisingly this only happens when x or y are outside the range of the array (oops!). In some ways it's better that it does not handle this error as gracefully as readPixel without using FrameBuffer because that is why I missed a particular bug in my indexing! Change nothing, let it crash to force better code proofing!
Teensy 4.0 freezes then reboots when calling this function. I have found that by disabling the use of the frame buffer beforehand, the crash is avoided and everything works fine. So, for example:
uint16_t pix = tft.readPixel(x, y); // crashes T4.0
tft.useFrameBuffer(false); uint16_t pix = tft.readPixel(x, y); // works fine tft.useFrameBuffer(true);
I was sure to use the function to wait for async screen update to finish beforehand, even tried not using it at all, but it was not this. It is something to do with the frame buffer being used.