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

E-Ink: additional conditions for "Dynamic Partial" mode #3256

Merged
merged 3 commits into from
Feb 21, 2024

Conversation

todd-herbert
Copy link
Contributor

@todd-herbert todd-herbert commented Feb 21, 2024

Purpose

Offer more tools for "dynamic partial" code to find the best balance of full-refresh and partial-refresh.
Lay groundwork for imminent pull-requests (Wireless Paper v1.1, sleep screens).

Why

When using partial-refresh, some E-Ink displays struggle to "erase" black pixels - to change an existing black pixel back to white. Rather than returning to white, these "erased" pixels can remain a light shade of gray. This is seen as "ghosting" - a faint version of the previous image remains visible.

The prevalence of this effect varies from display to display.
While working to implement partial-refresh for Heltec Wireless Paper V1.1, it has become clear that "ghosting" is somewhat more of an issue than with the V1.0 board.

What the pull-request implements

Two new "dynamic partial" controls are proposed here:

  • EINK_PARTIAL_ERASURE_LIMIT

    Only active if defined in variant.h. Attempts to track the amount of "erased pixels" since last full-refresh. When this amount eventually exceeds EINK_PARTIAL_ERASURE_LIMIT, ghosting is considered likely to be noticeable, and a full-refresh is forced.

    The tracking of "erased pixels" is an approximation, by comparing total black pixel count from image to image. Theoretically, an accurate number could be achieved by comparing image buffers pixel-to-pixel, but this would be more intrusive to implement.

  • demandFullRefresh()

    Public method, suitable to call from a FrameCallback. Single shot, specifies that the next update is cosmetic (splash screens?), and must be drawn with full-refresh, to maximize image quality. No calls to demandFullRefresh() are proposed in this specific pull-request

Performance

Overhead for entire "dynamic partial" code (incl. proposed changes):

  • typically <10µS per loop
  • 11ms for all checks to pass, approve partial refresh. (Including LOG_DEBUG() calls)

*Benchmarked on Heltec Wireless Paper

Supporting Media

Demonstration of EINK_PARTIAL_ERASURE_LIMIT

Highlights a scenario where "erasure limit" applies

EINK_PARTIAL_ERASURE_LIMIT.mp4

Flow Diagram for determineRefreshMode()

This section edited to correct error in diagram.
flow diagram for determineRefreshMode()

Copy link
Contributor

Choose a reason for hiding this comment

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

quite neat to count the amount of black pixels

thebentern added a commit to meshtastic/artifacts that referenced this pull request Feb 21, 2024
@thebentern thebentern merged commit 78b4a65 into meshtastic:master Feb 21, 2024
4 checks passed
jimwhitelaw pushed a commit to jimwhitelaw/aotromesh that referenced this pull request Feb 22, 2024
)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
jimwhitelaw pushed a commit to jimwhitelaw/aotromesh that referenced this pull request Feb 28, 2024
)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
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.

3 participants