This website requires JavaScript.
Explore
Help
Sign In
djsundog
/
circuitpython
Watch
1
Star
0
Fork
You've already forked circuitpython
0
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
f66c4cbfa6
circuitpython
/
tests
/
extmod
/
machine_pulse.py.exp
10 lines
79 B
Plaintext
Raw
Normal View
History
Unescape
Escape
tests/extmod: Add test for machine.time_pulse_us().
2016-09-16 09:31:02 -04:00
value: 1
value: 0
<class 'int'>
value: 1
value: 0
value: 1
<class 'int'>
extmod/machine_pulse: Make time_pulse_us() not throw exceptions. machine.time_pulse_us() is intended to provide very fine timing, including while working with signal bursts, where each transition is tracked in row. Throwing and handling an exception may take too much time and "signal loss". So instead, in case of a timeout, just return negative value. Cases of timeout while waiting for initial signal stabilization, and during actual timing, are recognized. The documentation is updated accordingly, and rewritten somewhat to clarify the function behavior.
2017-02-05 06:20:17 -05:00
-2
-1