diff --git a/Cargo.toml b/Cargo.toml index e984362..4b53811 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dht-pio" -version = "0.4.0" +version = "0.5.0" edition = "2021" license = "MIT" diff --git a/src/dht.rs b/src/dht.rs index 120de21..ea04c14 100644 --- a/src/dht.rs +++ b/src/dht.rs @@ -1,6 +1,6 @@ use cortex_m::delay::Delay; use pio_proc::pio_file; -use rp2040_hal::gpio::AnyPin; +use rp2040_hal::gpio::{AnyPin, FunctionPio0, Pin}; use rp2040_hal::pio::{PIOExt, Running, StateMachine, StateMachineIndex, Tx}; use rp2040_hal::pio::{Rx, UninitStateMachine}; @@ -27,7 +27,9 @@ impl DhtPio { let (int, frac) = (125, 0); let (mut sm, rx, tx) = rp2040_hal::pio::PIOBuilder::from_program(installed) + .out_pins(pin.id().num, 1) .set_pins(pin.id().num, 1) + .in_pin_base(pin.id().num) .clock_divisor_fixed_point(int, frac) .push_threshold(32) .build(sm);