-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Rework display refresh, add M4SK and add ePaper support #2085
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
Conversation
NOT TESTED! Just compiles Fixes micropython#1691
dhalbert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this massive amount of work!
|
Ok, changes are pushed. I'm still thinking over the ePaper refresh API. I kinda think the return of True/False is too silent because it's not obvious something is wrong. |
dhalbert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still also thinking about the refresh() calls, especially for ePaper. For a really long refresh cycle like ePaper, maybe the old refresh_soon() makes sense. But could call it schedule_refresh(), or refresh_needed(), or similar. There could also be a call seconds_until_refresh() that would return how much more time there is, and maybe even a 'refresh_done` property after that.
I'm thinking about some kind of use case where you might, say, light up an LED to indicate a refresh is on the way, an then turn it off when it's done. But maybe that's not real.
| } | ||
| return mp_const_none; | ||
| } | ||
| MP_DEFINE_CONST_FUN_OBJ_1(displayio_fourwire_reset_obj, displayio_fourwire_obj_reset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reasoning here behind rising an exception rather than just doing nothing? It forces us to repeat that check for pin everywhere (or catch the exception). Is there a use case where that exception is useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An ePaper display driver may need to detect whether a reset worked because the only way to exit a power down is to reset. Without it, the drivers must leave it on. (The monochrome featherwing needs it.)
|
@dhalbert The danger of a I already added a |
dhalbert
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is OK by me now. Thanks!
|
I'm going to merge this. @deshipu let me know if you'd like me to follow up with any more changes. |
This PR reworks the display refresh mechanics by replacing
wait_for_refreshandrefresh_soonwithrefresh.refreshis required for ePaper and not required for regular displays whenauto_refreshis True.auto_refreshcan be set during execution to prevent intermediate screen updates. This fixes #1691. 4.x code that callswait_for_refreshandrefresh_sooncan have it removed for nearly identical behavior. (wait_for_refreshmay have caused a slight delay that could be replaced by self-timing usingtime.monotonic)This also adds support for ePaper displays through a sister class to
Display. It can handle two color and three color displays.Lastly, Monster M4SK support was added to test the new refresh code. It also parameterizes the filesystem label so that it can be changed from the default
CIRCUITPY.