fix(embassy-rp): fix drop implementation of BufferedUartRx and BufferedUartTx

This commit is contained in:
tact1m4n3
2024-05-17 21:07:32 +03:00
parent 17dde65ac2
commit 5b2535c8a2
3 changed files with 87 additions and 72 deletions

View File

@@ -123,6 +123,11 @@ impl RingBuffer {
Some(Writer(self))
}
/// Return if buffer is available.
pub fn is_available(&self) -> bool {
!self.buf.load(Ordering::Relaxed).is_null() && self.len.load(Ordering::Relaxed) != 0
}
/// Return length of buffer.
pub fn len(&self) -> usize {
self.len.load(Ordering::Relaxed)