Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp Displayio and Add grayscale #114

Merged
merged 23 commits into from
Sep 29, 2023

Conversation

makermelissa
Copy link
Collaborator

@makermelissa makermelissa commented Sep 26, 2023

This change brings Displayio to being much closer in line with the current circuitpython builds, which makes it very accurate, but at this point it is not optimized for running in Python due to some removal of PIL. This adds dirty rectangle tracking as well. I have a bit more testing to do before optimization but it should support monochrome and grayscale OLEDs and allow me to close a number of outstanding issues.

Fixes #105
Fixes #95
Fixes #94
Fixes #54
Fixes #36
Fixes #32
Fixes #7
Fixes #6
Fixes #4

@makermelissa
Copy link
Collaborator Author

I just tested the SSD1327 and that's now working.
IMG_5375

@tannewt
Copy link
Member

tannewt commented Sep 27, 2023

Feel free to add me as reviewer when it is ready. Thanks for doing this!

@makermelissa
Copy link
Collaborator Author

I just tested the SSD1306. It's close, but still needs a little debugging done.
IMG_5377

@makermelissa
Copy link
Collaborator Author

Closer...
IMG_5378

@makermelissa
Copy link
Collaborator Author

If I had to guess, I'd say it's a row and column offset issue at this point.

@makermelissa
Copy link
Collaborator Author

SSD1325 tested good, which is useful since there's currently no Blinka drivers.
IMG_5380

@makermelissa
Copy link
Collaborator Author

SH1107 isn't super close, but maybe if I can get that working, the SSD1306 will work...
IMG_5382

@makermelissa
Copy link
Collaborator Author

Apparently it helps if you use the correct test script.
IMG_5383

@makermelissa
Copy link
Collaborator Author

I'm going to fix the SSD1306 and I think the PR will be ready at that point. The other possibility is that it's throwing some garbage to the display prior to writing as the right side of the rectangle does wrap to the left side.

@makermelissa
Copy link
Collaborator Author

The numbers were looking correct, so I decided to compare byte for byte what was being sent to the display. Here's the place where it differs between blinka and cp:
missing bytes

The bytes circled in red are not being sent, but the green ones are, which happens in the core's set_region_to_update() function, which is what I suspected. I think those are the command bytes that are missing.

@makermelissa
Copy link
Collaborator Author

Much better
IMG_5385

@makermelissa makermelissa marked this pull request as ready for review September 28, 2023 18:02
@makermelissa makermelissa requested review from tannewt, FoamyGuy and a team September 28, 2023 18:03
@makermelissa
Copy link
Collaborator Author

@FoamyGuy I added you as a reviewer since this change will likely affect https://github.com/FoamyGuy/Blinka_Displayio_PyGameDisplay since some of the "protected" functions have been renamed to match the ones used in the core.

The plan is to release this as 1.0.0 after this PR is merged, so it will be a new major version anyways.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work on this! Didn't see anything that needs updating. Thank you so much for doing this porting.

@makermelissa
Copy link
Collaborator Author

You're welcome. I think I found one more bug that needs fixing first.

@makermelissa makermelissa merged commit cfee25c into adafruit:main Sep 29, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants