Let the flashlight respect on_expander and expose LEDC channels#38
Merged
pascalzauberzeug merged 6 commits intomainfrom Apr 27, 2026
Merged
Let the flashlight respect on_expander and expose LEDC channels#38pascalzauberzeug merged 6 commits intomainfrom
on_expander and expose LEDC channels#38pascalzauberzeug merged 6 commits intomainfrom
Conversation
on_expander and expose LEDC channels
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…only) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
felixwrz
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
FlashlightHardwareignoredon_expanderand prefixed the LizardPwmOutputwith the expander name whenever an expander was passed, regardless of the flag.It also hard-coded the LEDC channel allocation, which can collide with other
PwmOutputs on the same chip — see #33.Implementation
on_expander: the expander prefix is only applied when both an expander is present andconfig.on_expanderis true.ledc_timer,front_ledc_channel,back_ledc_channelonFlashlightConfigurationand pass them as the second/third argument toPwmOutput(...).Defaults match the previous implicit allocation (timer 0, channels 0/1).
duty_cycle(0.0–1.0), converted to the 8-bit Lizard duty value; previous behavior (full brightness) is preserved as the default.A docstring note reminds users that the LEDC channels must not collide with other
PwmOutputs on the same chip.Progress