Skip to content

fix(lcd-clockless): keep active frame on DMA timeout - #5480

Merged
zackees merged 1 commit into
masterfrom
fix/lcd-clockless-retain-active-frame
Nov 25, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/lcd-clockless-retain-active-frame

Conversation

@zackees

@zackees zackees commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Summary

ESP32-S3 LCD clockless show() now drops the queued frame when the preceding DMA transfer misses its drain deadline. The callback and worker retain the active frame until completion. An initial transmission failure still allows the next frame to retry.

This is the clockless counterpart to #5479 and an edge case in the layered ESP32 show path tracked in #5356.

Evidence

  • The test alone reproduced a second transmission and premature buffer release under ASan/UBSan.
  • The fixed sanitizer suite and changed-file lint passed. The regression checks that the active frame completes and a fresh frame can then start.
  • Full host C++ validation is running. Full hosted CI includes the ESP32-S3 LCD emulator. The attached ESP32-C6 and LPC boards lack this S3-only path.

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability when displaying frames while another frame is still transmitting. The active transmission is preserved, and a frame that could not be queued is not sent later unless submitted again after the active frame completes. This helps prevent unexpected or incomplete frame updates.

@zackees zackees added the ci-full Run the complete release-equivalent CI matrix on this PR SHA label Nov 25, 2026
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review.

Walkthrough

The ESP32 LCD clockless driver now preserves active transmission state when readiness times out. A unit test checks that a queued frame is not transmitted until it is explicitly enqueued after the active frame completes.

Changes: ESP32 LCD clockless frame handling

Layer / File(s) Summary
Preserve active transmission and verify queued frames
src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp, tests/unit/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp
On a readiness timeout, show() clears newly enqueued channels and returns without releasing active transmission state. The test checks that a queued frame is not transmitted until it is explicitly enqueued after the active frame completes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to 16b58

The change keeps the active LCD frame alive when the previous DMA transfer misses its drain deadline, so a queued frame no longer causes a premature buffer release. A regression test covers the behavior. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the fix area (lcd-clockless) and the behavior change (keeping the active frame when the DMA times out). The raw summary says show() no longer forces release of active DMA channels afte…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the fix area (lcd-clockless) and the behavior change (keeping the active frame when the DMA times out). The raw summary says show() no longer forces release of active DMA channels after the 2-second readiness timeout, and it adds a test for repeated show() calls while a frame is active. The objectives describe the same edge case. The title is concise, uses the conventional fix(scope) form, and covers the primary change. It does not mention the added test, which is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 23d99f7 and 16b587d.

Files selected for processing: 2

  • src/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp.hpp
  • tests/unit/platforms/esp/32/drivers/lcd_spi/channel_driver_lcd_clockless.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 25, 2026
@github-actions github-actions Bot removed the ci-full Run the complete release-equivalent CI matrix on this PR SHA label Nov 25, 2026
@zackees
zackees enabled auto-merge November 25, 2026 14:50
@github-actions

Copy link
Copy Markdown
Contributor

Memory usage (this PR vs. its merge base)

Change in examples/Blink per target. The left number is this PR's image flash / attributed RAM in bytes; the colored delta is the change from the merge base (red ↑ is larger, green ↓ is smaller, Same is unchanged).

Target FLASH [bytes] RAM [bytes]
attiny85 2,460 (Same) 136 (Same)
esp32c3 322,844 (Same) 13,814 (Same)
esp32c6 351,430 (Same) 17,905 (Same)
esp32dev 285,587 (Same) 18,767 (Same)
esp32s3 318,715 (Same) 22,519 (Same)
esp8266 264,603 (Same) 6,808 (Same)
nrf52840_dk 66,976 (Same) 19,468 (Same)
rp2040 102,004 (Same) 8,624 (Same)
stm32f103c8 21,676 (Same) 1,789 (Same)
teensy41 46,080 (Same) 21,738 (Same)
uno 3,644 (Same) 134 (Same)

@zackees
zackees added this pull request to the merge queue Nov 25, 2026
Merged via the queue into master with commit e1e898c Nov 25, 2026
354 of 493 checks passed
@zackees
zackees deleted the fix/lcd-clockless-retain-active-frame branch November 25, 2026 15:24
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant