i2c-v2: Deref interrupt enabling in write_dma_internal

This commit is contained in:
Thales Fragoso 2021-07-26 20:13:23 -03:00
parent 6ddc83029a
commit c1bb83d29d

View File

@ -407,7 +407,9 @@ impl<'d, T: Instance, TXDMA, RXDMA> I2c<'d, T, TXDMA, RXDMA> {
let regs = T::regs(); let regs = T::regs();
regs.cr1().modify(|w| { regs.cr1().modify(|w| {
w.set_txdmaen(true); w.set_txdmaen(true);
if first_slice {
w.set_tcie(true); w.set_tcie(true);
}
}); });
let dst = regs.txdr().ptr() as *mut u8; let dst = regs.txdr().ptr() as *mut u8;
@ -442,9 +444,9 @@ impl<'d, T: Instance, TXDMA, RXDMA> I2c<'d, T, TXDMA, RXDMA> {
); );
} }
} else { } else {
// NOTE(unsafe) self.tx_dma does not fiddle with the i2c registers
unsafe { unsafe {
Self::master_continue(total_len.min(255), (total_chunks != 1) || !last_slice); Self::master_continue(total_len.min(255), (total_chunks != 1) || !last_slice);
T::regs().cr1().modify(|w| w.set_tcie(true));
} }
} }