Browse Source

impl Send for serial Rx and Tx abstractions

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
features/pwm
Daniel Egger 4 years ago
parent
commit
1ed311cd62
  1. 6
      src/serial.rs

6
src/serial.rs

@ -149,12 +149,18 @@ pub struct Rx<USART> {
usart: *const USART,
}
// NOTE(unsafe) Required to allow protected shared access in handlers
unsafe impl<USART> Send for Rx<USART> {}
/// Serial transmitter
pub struct Tx<USART> {
// This is ok, because the USART types only contains PhantomData
usart: *const USART,
}
// NOTE(unsafe) Required to allow protected shared access in handlers
unsafe impl<USART> Send for Tx<USART> {}
macro_rules! usart {
($($USART:ident: ($usart:ident, $usartXen:ident, $apbenr:ident),)+) => {
$(

Loading…
Cancel
Save