This website requires JavaScript.
Odkrywaj
Pomoc
Zarejestruj się
Zaloguj się
mirror
/
micropython
kopia lustrzana
https://github.com/micropython/micropython
Obserwuj
1
Polub
0
Forkuj
You've already forked micropython
0
Kod
Zgłoszenia
Projekty
Wydania
Wiki
Aktywność
26b4ef4c46
micropython
/
tests
/
extmod
/
machine_pulse.py.exp
10 wiersze
79 B
Plaintext
Czysty
Zwykły widok
Historia
Unescape
Escape
tests/extmod: Add test for machine.time_pulse_us().
2016-09-16 13:31:02 +00: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 11:20:17 +00:00
-2
-1