Trying to fix clock divider
This commit is contained in:
parent
31d222e0b0
commit
102f60cbf6
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
use embassy_rp::pio::{Common, Config, Instance, PioPin, StateMachine};
|
use embassy_rp::pio::{Common, Config, Instance, PioPin, StateMachine};
|
||||||
use embassy_time::Timer;
|
use embassy_time::Timer;
|
||||||
use fixed::traits::ToFixed;
|
use fixed::traits::ToFixed;
|
||||||
|
use fixed_macro::types::U56F8;
|
||||||
use pio_proc::pio_file;
|
use pio_proc::pio_file;
|
||||||
|
|
||||||
use crate::DhtError;
|
use crate::DhtError;
|
||||||
|
@ -25,7 +26,7 @@ impl<'d, PIO: Instance, const SM: usize> DhtPio<'d, PIO, SM> {
|
||||||
config.set_set_pins(&[&pin]);
|
config.set_set_pins(&[&pin]);
|
||||||
config.set_in_pins(&[&pin]);
|
config.set_in_pins(&[&pin]);
|
||||||
config.shift_out.threshold = 32;
|
config.shift_out.threshold = 32;
|
||||||
config.clock_divider = 125.to_fixed();
|
config.clock_divider = (U56F8!(125_000_000) / 125).to_fixed();
|
||||||
|
|
||||||
sm.set_pin_dirs(embassy_rp::pio::Direction::Out, &[&pin]);
|
sm.set_pin_dirs(embassy_rp::pio::Direction::Out, &[&pin]);
|
||||||
sm.set_config(&config);
|
sm.set_config(&config);
|
||||||
|
|
Loading…
Reference in a new issue