Fix misuse of INT_CLR (#1651)

* Fix misuse of INT_CLR

* Use LCD_START instead of interrupt to check for completion
This commit is contained in:
Dominic Fischer 2024-06-05 14:40:55 +01:00 committed by GitHub
parent f125c20cf2
commit a20054c90c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -233,9 +233,9 @@ where
impl<'d, TX: Tx, P: TxPins> DmaSupport for I8080<'d, TX, P> {
fn peripheral_wait_dma(&mut self, _is_tx: bool, _is_rx: bool) {
let dma_int_raw = self.lcd_cam.lc_dma_int_raw();
// Wait until LCD_TRANS_DONE is set.
while dma_int_raw.read().lcd_trans_done_int_raw().bit_is_clear() {}
let lcd_user = self.lcd_cam.lcd_user();
// Wait until LCD_START is cleared by hardware.
while lcd_user.read().lcd_start().bit_is_set() {}
self.tear_down_send();
}
@ -310,9 +310,9 @@ where
self.start_write_bytes_dma(data.as_ptr() as _, core::mem::size_of_val(data))?;
self.start_send();
let dma_int_raw = self.lcd_cam.lc_dma_int_raw();
// Wait until LCD_TRANS_DONE is set.
while dma_int_raw.read().lcd_trans_done_int_raw().bit_is_clear() {}
let lcd_user = self.lcd_cam.lcd_user();
// Wait until LCD_START is cleared by hardware.
while lcd_user.read().lcd_start().bit_is_set() {}
self.tear_down_send();
@ -405,13 +405,15 @@ impl<'d, TX: Tx, P> I8080<'d, TX, P> {
}
fn tear_down_send(&mut self) {
// This will already be cleared unless the user is trying to cancel,
// which is why this is still here.
self.lcd_cam
.lcd_user()
.modify(|_, w| w.lcd_start().clear_bit());
self.lcd_cam
.lc_dma_int_clr()
.write(|w| w.lcd_trans_done_int_clr().clear_bit());
.write(|w| w.lcd_trans_done_int_clr().set_bit());
}
fn start_write_bytes_dma(&mut self, ptr: *const u8, len: usize) -> Result<(), DmaError> {