From 5ef4c23e03e0e461f7a4ad8b6397837317bef18a Mon Sep 17 00:00:00 2001 From: hodasemi Date: Thu, 14 Mar 2024 07:01:27 +0100 Subject: [PATCH] Fix numbers --- Cargo.toml | 1 - src/dht.rs | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b27e7b6..53e8dbf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,5 +22,4 @@ pio-proc = "0.2.2" pio = "0.2.1" fixed = "1.23.1" -fixed-macro = "1.2" diff --git a/src/dht.rs b/src/dht.rs index d37055b..8c9b707 100644 --- a/src/dht.rs +++ b/src/dht.rs @@ -1,7 +1,6 @@ use embassy_rp::pio::{Common, Config, Instance, PioPin, StateMachine}; use embassy_time::Timer; use fixed::traits::ToFixed; -use fixed_macro::types::U56F8; use pio_proc::pio_file; use crate::DhtError; @@ -26,10 +25,10 @@ impl<'d, PIO: Instance, const SM: usize> DhtPio<'d, PIO, SM> { config.set_set_pins(&[&pin]); config.set_in_pins(&[&pin]); config.shift_out.threshold = 32; - config.clock_divider = (U56F8!(125_000_000) / 125).to_fixed(); + config.clock_divider = 125.to_fixed(); + sm.set_config(&config); sm.set_pin_dirs(embassy_rp::pio::Direction::Out, &[&pin]); - sm.set_config(&config); sm.set_enable(true); Self { sm }