Wykres commitów

9 Commity (1c7afa923b416f51d1c43417e32fd958da2f0c67)

Autor SHA1 Wiadomość Data
Damien George 1c7afa923b drivers/dht: Only build DHT driver if MICROPY_PY_MACHINE_PULSE enabled.
Because this driver calls `machine_time_pulse_us()`.

Signed-off-by: Damien George <damien@micropython.org>
2024-02-07 13:45:51 +11:00
Damien George d336c1b79b extmod/modmachine: Consolidate simple machine headers into modmachine.h.
The contents of machine_bitstream.h, machine_pinbase.h, machine_pulse.h and
machine_signal.h have been moved into extmod/modmachine.h.

Signed-off-by: Damien George <damien@micropython.org>
2023-10-26 16:49:27 +11:00
Jim Mussared def76fe4d9 all: Use MP_ERROR_TEXT for all error messages. 2020-04-05 15:02:06 +10:00
Damien George f102ac54e9 drivers/dht: Allow open-drain-high call to be DHT specific if needed.
Some ports (eg esp8266) need to have specific behaviour for driving a DHT
reliably.
2019-01-22 00:23:05 +11:00
Javier Candeira 35a1fea90b all: Raise exceptions via mp_raise_XXX
- Changed: ValueError, TypeError, NotImplementedError
  - OSError invocations unchanged, because the corresponding utility
    function takes ints, not strings like the long form invocation.
  - OverflowError, IndexError and RuntimeError etc. not changed for now
    until we decide whether to add new utility functions.
2017-08-13 22:52:33 +10:00
Paul Sokolovsky d5e9ab6e61 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 14:20:17 +03:00
Damien George e3d29996b3 driver/dht: Use mp_raise_OSError helper function. 2016-10-07 13:53:34 +11:00
Damien George 4940bee62a extmod: Add machine time_pulse_us function (at C and Python level).
The C implementation is taken from the DHT driver.
2016-05-31 13:58:48 +01:00
Damien George 48a7ef0576 drivers: Add C-level function to read DHT11 and DHT22 devices.
Uses mp_hal_pin API.
2016-05-26 17:10:06 +01:00