This commit is contained in:
Rafael Bachmann 2024-03-25 15:09:41 +01:00
parent cf789be420
commit e139a4e076
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
//! Clock configuration for the RP2040 //! Clock configuration for the RP2040
use core::arch::asm;
use core::marker::PhantomData; use core::marker::PhantomData;
use core::sync::atomic::{AtomicU16, AtomicU32, Ordering}; use core::sync::atomic::{AtomicU16, AtomicU32, Ordering};
@ -7,6 +8,7 @@ use pac::clocks::vals::*;
use crate::gpio::sealed::Pin; use crate::gpio::sealed::Pin;
use crate::gpio::AnyPin; use crate::gpio::AnyPin;
use crate::pac::common::{Reg, RW};
use crate::{pac, reset, Peripheral}; use crate::{pac, reset, Peripheral};
// NOTE: all gpin handling is commented out for future reference. // NOTE: all gpin handling is commented out for future reference.

View File

@ -749,7 +749,7 @@ impl<'d, PIO: Instance + 'd, const SM: usize> StateMachine<'d, PIO, SM> {
w.set_set_count(1); w.set_set_count(1);
}); });
// SET PINDIRS, (dir) // SET PINDIRS, (dir)
unsafe { sm.exec_instr(0b1110_0000_1000_0000 | dir as u16) }; unsafe { sm.exec_instr(0b111_00000_100_00000 | dir as u16) };
} }
}); });
} }
@ -764,7 +764,7 @@ impl<'d, PIO: Instance + 'd, const SM: usize> StateMachine<'d, PIO, SM> {
w.set_set_count(1); w.set_set_count(1);
}); });
// SET PINS, (dir) // SET PINS, (dir)
unsafe { sm.exec_instr(0b1110_0000_0000_0000 | level as u16) }; unsafe { sm.exec_instr(0b11100_000_000_00000 | level as u16) };
} }
}); });
} }