impl Send for serial Rx and Tx abstractions
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
This commit is contained in:
parent
b56040d28e
commit
1ed311cd62
|
@ -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…
Reference in New Issue