diff --git a/src/dma.rs b/src/dma.rs index 93be321..653c551 100644 --- a/src/dma.rs +++ b/src/dma.rs @@ -198,6 +198,11 @@ macro_rules! dma { } impl CircBuffer { + /// clears interrupt + pub fn clear_interrupt(&mut self) { + self.channel.ifcr().write(|w| w.$cgifX().set_bit()); + } + /// Peeks into the readable half of the buffer pub fn peek(&mut self, f: F) -> Result where @@ -213,7 +218,6 @@ macro_rules! dma { // XXX does this need a compiler barrier? let ret = f(buf, half_being_read); - let isr = self.channel.isr(); let first_half_is_done = isr.$htifX().bit_is_set(); let second_half_is_done = isr.$tcifX().bit_is_set();