Skip to content

follow-up: avoid shrinking LCD_CLOCKLESS chunks from #2648 #2688

Closed

Description

@zackees

Source PR: #2648
Source CodeRabbit comment: #2648 (comment)

CodeRabbit suggestion:

Round chunkInputBytes up instead of shrinking it via numChunks.

This loop can collapse a near-1024-byte request into many small ISR-driven chunks. For example, maxSize = 1025 yields 5 chunks of 205 bytes, even though a single 1025-byte chunk would satisfy the equal-size requirement. That defeats the fallback meant to avoid the ISR re-arm path and raises interrupt load on awkward frame sizes.

Replace the divisor-seeking loop logic around numChunks/chunkInputBytes: keep the initial numChunks = ceil(maxSize / requestedChunkInputBytes), then set chunkInputBytes = ceil_div(maxSize, numChunks) and do not increment numChunks to force an exact divisor; fall back to chunkInputBytes = maxSize only if that computed chunkInputBytes is 0.

Why this matters: current origin/master still uses the divisor-seeking numChunks loop in ChannelDriverLcdClockless::beginTransmission(). Awkward frame sizes just above the 1024-byte default can be split into extra ISR-driven chunks, which undermines the workaround for the still-broken multi-chunk re-arm path and increases interrupt load.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions