Rework bufferedUart to get rid of PeripheralMutex in a similar fashion as nrf & rp. Also adds embedded-hal traits to bufferedUart

This commit is contained in:
Mathias
2023-03-31 10:43:30 +02:00
parent 7a841b58d1
commit cfbe93c280
2 changed files with 490 additions and 269 deletions

View File

@ -1112,6 +1112,9 @@ pub(crate) mod sealed {
fn regs() -> Regs;
fn state() -> &'static State;
#[cfg(feature = "nightly")]
fn buffered_state() -> &'static buffered::State;
}
pub trait FullInstance: BasicInstance {
@ -1147,6 +1150,12 @@ macro_rules! impl_lpuart {
static STATE: crate::usart::sealed::State = crate::usart::sealed::State::new();
&STATE
}
#[cfg(feature = "nightly")]
fn buffered_state() -> &'static buffered::State {
static STATE: buffered::State = buffered::State::new();
&STATE
}
}
impl BasicInstance for peripherals::$inst {}