Skip to content

Commit d3bfff4

Browse files
committed
Add check functions to CircBuffer.
1 parent 8e63159 commit d3bfff4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/dma.rs

+29
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,35 @@ where
333333
}
334334
}
335335

336+
impl<BUFFER, PAYLOAD, CHANNEL> CircBuffer<BUFFER, RxDma<PAYLOAD, CHANNEL>>
337+
where
338+
PAYLOAD: CharacterMatch,
339+
{
340+
/// Checks to see if the peripheral has detected a character match and
341+
/// clears the flag
342+
pub fn check_character_match(&mut self, clear: bool) -> bool {
343+
self.payload.payload.check_character_match(clear)
344+
}
345+
}
346+
347+
impl<BUFFER, PAYLOAD, CHANNEL> CircBuffer<BUFFER, RxDma<PAYLOAD, CHANNEL>>
348+
where
349+
PAYLOAD: ReceiverTimeout,
350+
{
351+
pub fn check_receiver_timeout(&mut self, clear: bool) -> bool {
352+
self.payload.payload.check_receiver_timeout(clear)
353+
}
354+
}
355+
356+
impl<BUFFER, PAYLOAD, CHANNEL> CircBuffer<BUFFER, RxDma<PAYLOAD, CHANNEL>> {
357+
pub fn check_operation_error<O, E>(&mut self) -> Result<O, E>
358+
where
359+
PAYLOAD: OperationError<O, E>,
360+
{
361+
self.payload.payload.check_operation_error()
362+
}
363+
}
364+
336365
pub trait DmaExt {
337366
type Channels;
338367

0 commit comments

Comments
 (0)