-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
PWM from 10845 and time_hardware_pulse_us() and test from 16147. #16161
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
PWM from 10845 and time_hardware_pulse_us() and test from 16147. #16161
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:
|
You can always make these test on local instances of the repository. No need to go to github and waste processing time. |
#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>
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