mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-11 04:51:31 +11:00
Mark PIO StateMachine, Rx and Tx as Send (#177)
* Mark PIO StateMachine, Rx and Tx as Send * Improve comment grammar. Co-authored-by: Wilfried Chauveau <wilfried.chauveau@ithinuel.me>
This commit is contained in:
parent
73e2c6921f
commit
fe1e55b8c0
|
@ -516,6 +516,9 @@ impl<SM: ValidStateMachine, State> StateMachine<SM, State> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Safety: All shared register accesses are atomic.
|
||||
unsafe impl<SM: ValidStateMachine + Send, State> Send for StateMachine<SM, State> {}
|
||||
|
||||
impl<SM: ValidStateMachine> StateMachine<SM, Stopped> {
|
||||
/// Starts execution of the selected program.
|
||||
pub fn start(mut self) -> StateMachine<SM, Running> {
|
||||
|
@ -676,6 +679,9 @@ pub struct Rx<SM: ValidStateMachine> {
|
|||
_phantom: core::marker::PhantomData<SM>,
|
||||
}
|
||||
|
||||
/// Safety: All shared register access is atomic.
|
||||
unsafe impl<SM: ValidStateMachine + Send> Send for Rx<SM> {}
|
||||
|
||||
impl<SM: ValidStateMachine> Rx<SM> {
|
||||
fn register_block(&self) -> &pac::pio0::RegisterBlock {
|
||||
// Safety: The register is unique to this Tx instance.
|
||||
|
@ -713,6 +719,9 @@ pub struct Tx<SM: ValidStateMachine> {
|
|||
_phantom: core::marker::PhantomData<SM>,
|
||||
}
|
||||
|
||||
/// Safety: All shared register access is atomic.
|
||||
unsafe impl<SM: ValidStateMachine + Send> Send for Tx<SM> {}
|
||||
|
||||
impl<SM: ValidStateMachine> Tx<SM> {
|
||||
fn register_block(&self) -> &pac::pio0::RegisterBlock {
|
||||
// Safety: The register is unique to this Tx instance.
|
||||
|
|
Loading…
Reference in a new issue