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

LEDC - Allow custom channel selection #9031

Merged

Conversation

P-R-O-C-H-Y
Copy link
Member

@P-R-O-C-H-Y P-R-O-C-H-Y commented Dec 21, 2023

Description of Change

This PR adds a new API ledcAttachChannel to LEDC peripheral, so the LEDC channel can be specified and won't be automatically selected, like is done by the ledcAttach function.

bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t channel);

Also added info log message what channel is used when LEDC is attached to pin.

Tests scenarios

Tested on ESP32-C6 with edited LEDC Software fade example.

Related links

Closes #8967

@P-R-O-C-H-Y P-R-O-C-H-Y added the Area: Peripherals API Relates to peripheral's APIs. label Dec 21, 2023
@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Dec 21, 2023
Copy link
Contributor

github-actions bot commented Dec 21, 2023

Warnings
⚠️ Please consider squashing your 6 commits (simplifying branch history).

👋 Hello P-R-O-C-H-Y, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against fd7fca5

@P-R-O-C-H-Y P-R-O-C-H-Y marked this pull request as ready for review December 22, 2023 12:35
@P-R-O-C-H-Y P-R-O-C-H-Y added the Status: Review needed Issue or PR is awaiting review label Dec 22, 2023
@P-R-O-C-H-Y P-R-O-C-H-Y added this to the 3.0.0-RC1 milestone Dec 22, 2023
Copy link
Collaborator

@lucasssvaz lucasssvaz left a comment

Choose a reason for hiding this comment

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

LGTM

@me-no-dev
Copy link
Member

what happens on ESP32 where we have 2x8 channels?

@P-R-O-C-H-Y
Copy link
Member Author

what happens on ESP32 where we have 2x8 channels?

You can select channel 0-15.

@Hs-Cheng
Copy link

Hs-Cheng commented Jan 3, 2024

Excuse me, I just want to ask if the above modification to the ledc library has been added to the 3.0.0-Alpha3 version? Can I download the newest code if I download 3.0.0-Alpha3 from the Arduino IDE?

Thank you.

@P-R-O-C-H-Y
Copy link
Member Author

Excuse me, I just want to ask if the above modification to the ledc library has been added to the 3.0.0-Alpha3 version? Can I download the newest code if I download 3.0.0-Alpha3 from the Arduino IDE?

Thank you.

Hello @Hs-Cheng, this change was not merged yet. If you want to test/use this modification you need to manually update the source code with changes from this PR or if you use manual installation instead of board manager in Arduino IDE, you can simply checkout this PR.

@me-no-dev me-no-dev merged commit 8a1e463 into espressif:master Jan 8, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Peripherals API Relates to peripheral's APIs. Status: Review needed Issue or PR is awaiting review
Projects
Development

Successfully merging this pull request may close these issues.

New LEDC auto channel function needs ability to manual adjust channel.
4 participants