The dimensions in UserConfig were already like you posted. So did not touch them (they are already in portrait mode, as in width is smaller then height, even though it works correctly in landscape only, which is odd).
Copied your code (assumed the layer declarations) but it remains in landscape.
If i put debug output between the orientations changes i only get one. So it appears to be crashing…
When I actually do switch the dimensions in UserConfig.h to:
#define TFT_WIDTH 160 // Screen width in pixels
#define TFT_HEIGHT 128 // Screen height in pixels
It actually does not crash any more.
But I get:
It appears to be some memory corruption perhaps.
Been looking at the MADCTL register. But I can spot no obvious errors. Not unless you cache the access points somewhere perhaps…
Actually appeared the debugger scared if off.
It’s not crashing any more.
Suspecting that might have something to do with timing and flushing.
There are still bands (rects really) however that seem to be out of reach…
Edit:
Actually I have been able to provoke the crash (that was presumably what was happening when I saw the garbled screen earlier).
It appears to happen when flushing after setting it to Degre_0 at this position:
i get an exception:
#define SCB_CFSR_IMPRECISERR ((uint32_t)0x00000400) /*!< Imprecise data bus error */
Hello,
There is indeed a bug that appears when the number of vertical blocks is different from the number of horizontal blocks. I will fix this issue, but it is not trivial.
Thank you for helping me discover this problem and thus improve the reliability of the driver.
Philippe
This is something I was working on as well, haven’t made much progress, I was doing that and changing the color formatting from RGB to HSV, just to make it easier to cycle through colors