nrf
This commit is contained in:
parent
f5e3f31df7
commit
08f1454527
1 changed files with 18 additions and 0 deletions
|
@ -766,6 +766,12 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarteRx<'d, U, T> {
|
||||||
rx.pop_done(amt);
|
rx.pop_done(amt);
|
||||||
U::regs().intenset.write(|w| w.rxstarted().set());
|
U::regs().intenset.write(|w| w.rxstarted().set());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// we are ready to read if there is data in the buffer
|
||||||
|
fn read_ready() -> Result<bool, Error> {
|
||||||
|
let state = T::buffered_state();
|
||||||
|
Ok(!state.rx_buf.is_empty())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, U: UarteInstance, T: TimerInstance> Drop for BufferedUarteRx<'a, U, T> {
|
impl<'a, U: UarteInstance, T: TimerInstance> Drop for BufferedUarteRx<'a, U, T> {
|
||||||
|
@ -827,6 +833,18 @@ mod _embedded_io {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'d, U: UarteInstance, T: TimerInstance + 'd> embedded_io_async::ReadReady for BufferedUarte<'d, U, T> {
|
||||||
|
fn read_ready(&mut self) -> Result<bool, Self::Error> {
|
||||||
|
BufferedUarteRx::<'d, T>::read_ready()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'d, U: UarteInstance, T: TimerInstance + 'd> embedded_io_async::ReadReady for BufferedUarteRx<'d, U, T> {
|
||||||
|
fn read_ready(&mut self) -> Result<bool, Self::Error> {
|
||||||
|
Self::read_ready()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'d, U: UarteInstance, T: TimerInstance> embedded_io_async::BufRead for BufferedUarte<'d, U, T> {
|
impl<'d, U: UarteInstance, T: TimerInstance> embedded_io_async::BufRead for BufferedUarte<'d, U, T> {
|
||||||
async fn fill_buf(&mut self) -> Result<&[u8], Self::Error> {
|
async fn fill_buf(&mut self) -> Result<&[u8], Self::Error> {
|
||||||
self.fill_buf().await
|
self.fill_buf().await
|
||||||
|
|
Loading…
Add table
Reference in a new issue