PWM from 10845 and time_hardware_pulse_us() and test from 16147.#16161
Closed
IhorNehrutsa wants to merge 40 commits into
Closed
PWM from 10845 and time_hardware_pulse_us() and test from 16147.#16161IhorNehrutsa wants to merge 40 commits into
IhorNehrutsa wants to merge 40 commits into
Conversation
Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
The difference from `time_pulse_us` is that if the pin is initially equal to *pulse_level* then `time_pulse_us` counts the pulse duration immediately, but `time_hardware_pulse_us` first waits the different *pulse_level*, then waits the equal to *pulse_level* and then counts pulse duration. Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
|
Code size report: |
Contributor
|
You can always make these test on local instances of the repository. No need to go to github and waste processing time. |
This was referenced Nov 5, 2024
#define TEST_JITTER 0
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
The difference from `time_pulse_us` is that if the pin is initially equal to *pulse_level* then `time_pulse_us` counts the pulse duration immediately, but `time_hardware_pulse_us` first waits for the different *pulse_level*, then waits the equal to *pulse_level* and then counts pulse duration. Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com> Co-Authored-By: Robert Hammelrath <12476868+robert-hh@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #16161 +/- ##
==========================================
- Coverage 98.57% 98.56% -0.01%
==========================================
Files 164 164
Lines 21349 21354 +5
==========================================
+ Hits 21045 21048 +3
- Misses 304 306 +2 ☔ View full report in Codecov by Sentry. |
…ware_pulse_and_Test
…ware_pulse_and_Test
Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com> Co-Authored-By: Robert Hammelrath <12476868+robert-hh@users.noreply.github.com> Co-Authored-By: Andrew Leech <3318786+andrewleech@users.noreply.github.com>
If the pin is initially equal to *pulse_level* then first waits until the pin input becomes different from *pulse_level*. Then the function waits until the pin input becomes equal to *pulse_level*, then the func counts the duration that the pin is equal to *pulse_level*. Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com> Co-Authored-By: Robert Hammelrath <12476868+robert-hh@users.noreply.github.com>
…ware_pulse_and_Test
If the pin is initially equal to *pulse_level* then first waits until the pin input becomes different from *pulse_level*. Then the function waits until the pin input becomes equal to *pulse_level*, then the func counts the duration that the pin is equal to *pulse_level*. Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com> Co-Authored-By: Robert Hammelrath <12476868+robert-hh@users.noreply.github.com>
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.
Do not merge to the master.
Only for tests.
Merged form:
esp32/PWM: Reduce inconsitencies between ports. #10854
machine: Add time_hardware_pulse_us function. #16160
tests/extmod_hardware: Add a test for machine.PWM freq and duty. #16147
The results of the ESP32 tests are on:
50Hz -10kHz, step 12.5% of duty tests/extmod_hardware/machine_pwm_esp32_50_10k.exp
1Hz - 40MHz, step 25% of duty tests/extmod_hardware/machine_pwm_esp32_1_40M.exp