Skip to content

feat(lilygo-tdeck-max): wire up the EPD frontlight - #636

Open
Crazypedia wants to merge 2 commits into
TactilityProject:mainfrom
Crazypedia:feat/tdeckmax-frontlight
Open

feat(lilygo-tdeck-max): wire up the EPD frontlight#636
Crazypedia wants to merge 2 commits into
TactilityProject:mainfrom
Crazypedia:feat/tdeckmax-frontlight

Conversation

@Crazypedia

@Crazypedia Crazypedia commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Closes #629. Builds on #633, which is now merged.

Devicetree only. The panel is reflective, so this lights it from the front, but it is still a BACKLIGHT_TYPE device and shows up as the usual Display brightness slider.

BL_PWM is GPIO41. It has to use LEDC timer/channel 1, because timer/channel 0 is already taken by the keyboard backlight on this board.

The backlight node is left status = "disabled" so Boot starts it and applies the stored brightness, the same handling every other board's backlight gets.

Tested: LilyGO T-Deck Max. The brightness slider appears in Display settings and lights the panel.

Two things worth noting, neither addressed here:

Boot logs W ledc: GPIO 41 is not usable, maybe conflict with others. It is benign: pwm_backlight's start() reserves the pin, then the boot brightness apply reserves it again, and the second esp_gpio_reserve() warns. The panel lights correctly. Happy to look at silencing it separately if you would rather not ship a warning.

This is also the board that motivated your backlight_set_brightness_default() idea on #625: it comes up at the board-agnostic 200/255 default, which lights a panel that is perfectly readable without it. I have deliberately left that out of here since it touches every board.

Summary by CodeRabbit

  • New Features
    • Added PWM-based brightness control for the EPD display backlight.
    • Added dedicated backlight configuration support, disabled by default to preserve existing display behavior.
    • The backlight can now be connected to the display and controlled through compatible software or board configurations.

Devicetree only, on top of the optional-frontlight support from TactilityProject#633.

The panel is reflective, so this lights it from the front, but it is still a
BACKLIGHT_TYPE device and shows up as the usual Display brightness slider.

BL_PWM is GPIO41. It has to use LEDC timer/channel 1 because timer/channel 0 is
already taken by the keyboard backlight on this board.

The backlight node is left disabled so Boot starts it and applies the stored
brightness, which is the same handling every other board's backlight gets.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dd7542d4-f7af-4654-a838-6c529b57fbb9

📥 Commits

Reviewing files that changed from the base of the PR and between 5c96f49 and 28c33df.

📒 Files selected for processing (1)
  • Devices/lilygo-tdeck-max/lilygo,tdeck-max.dts

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The device tree connects the EPD display to a new pwm-backlight node. The backlight uses an ESP32 LEDC PWM channel on GPIO41 with a 33.3 µs period and timer/channel 1. The backlight node is disabled by default.

Merge Risk: ⚪ Minimal · up to 28c33

This change adds the LilyGO T-Deck Max EPD frontlight through its existing display brightness controls without altering broader runtime behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: wiring the LilyGO T-Deck Max EPD frontlight.
Linked Issues check ✅ Passed The devicetree changes configure the EPD frontlight on GPIO41 with LEDC timer/channel 1 and expose it through the standard pwm-backlight brightness control, matching issue #629.
Out of Scope Changes check ✅ Passed The pull request contains only the requested devicetree changes for the LilyGO T-Deck Max EPD frontlight. No unrelated changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@KenVanHoeylandt

Copy link
Copy Markdown
Contributor

The order of display_backlight is likely causing the build failure. It needs to be above the device that references it.

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.

LilyGO T-Deck Max: wire up the EPD frontlight

2 participants