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

Add support for setting the channel input filter #2136

Merged
merged 3 commits into from
Sep 27, 2023
Merged

Conversation

dberlin
Copy link
Contributor

@dberlin dberlin commented Sep 22, 2023

Pull Request template

Please, Make sure that your PR is not a duplicate.
Search among the Pull request before creating one.

IMPORTANT: Please review the CONTRIBUTING.md file for detailed contributing guidelines.

Thanks for submitting a pull request.
Please provide enough information so that others can review your pull request:

Summary

This PR implements the following feature

  • Support for input channel filtering in HardwareTimer

Currently, HardwareTimer sets the input channel filter to none, any time the mode of the timer is set.
This PR enables the input filter to be set along with the mode.

It is possible to enable setting the input filter separately from the mode if wanted.

Validation

Tested with a waveform generator vs sketch outputting pulse widths + levels

@fpistm fpistm added the enhancement New feature or request label Sep 23, 2023
@fpistm
Copy link
Member

fpistm commented Sep 25, 2023

Hi @dberlin
thanks for this PR.
Could you also share your test sketch, please ?

@dberlin
Copy link
Contributor Author

dberlin commented Sep 26, 2023

Hi @dberlin thanks for this PR. Could you also share your test sketch, please ?

Sure.

Removing a whole bunch, it's attached:
Note - i use platformio, and define the c++ standard flag to gnu++17.
The sketch also uses the streaming library, but this could be easily changed.

I parse the pulses out and verify the results.
main.cpp.txt

Copy link
Contributor

@ABOSTM ABOSTM left a comment

Choose a reason for hiding this comment

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

Thanks @dberlin
LGTM

@fpistm fpistm added this to the 2.7.0 milestone Sep 26, 2023
@fpistm fpistm merged commit 61a1680 into stm32duino:main Sep 27, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

3 participants