Skip to content

Conversation

@alxhoff
Copy link

@alxhoff alxhoff commented Mar 25, 2020

…terface Control), MADCTL is set to XOR of IFCTL and MADCTL, setting 0 to IFCTL before MADCTL is set to ensure passed MADCTL byte is set.

Was having issues with BGR colours on my Pi Zero and generic ILI9341, I believe this is the root of the issue. Fixed it for me.

alxhoff added 2 commits March 25, 2020 11:30
…terface Control), inverse of MADCTL byte is first set into IFCTL to ensure MADCTL is set.
@juj
Copy link
Owner

juj commented Apr 3, 2020

Thanks for the contribution. It is odd that toggling MADCTL_BGR_PIXEL_ORDER did not invert BGR, because like the spec says, it is treated as an XOR of the bit value. Then passing either 0 or 1 should cause a flipped value.

If this PR works, it seems as if the result is more like a NAND ratherthan XOR, i.e. a ~IFCTL & MADCTL instead of IFCTL ^ MADCTL?

Without this PR, did both enabled and disabled cases of DISPLAY_SWAP_BGR produce the same wrong colors?

@alxhoff
Copy link
Author

alxhoff commented Apr 3, 2020

I will have it another test over the weekend. My guess was that IFCTL was not always zero'd out when setting MADCTL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants