@@ -233,9 +233,9 @@ where
233
233
234
234
impl < ' d , TX : Tx , P : TxPins > DmaSupport for I8080 < ' d , TX , P > {
235
235
fn peripheral_wait_dma ( & mut self , _is_tx : bool , _is_rx : bool ) {
236
- let dma_int_raw = self . lcd_cam . lc_dma_int_raw ( ) ;
237
- // Wait until LCD_TRANS_DONE is set .
238
- while dma_int_raw . read ( ) . lcd_trans_done_int_raw ( ) . bit_is_clear ( ) { }
236
+ let lcd_user = self . lcd_cam . lcd_user ( ) ;
237
+ // Wait until LCD_START is cleared by hardware .
238
+ while lcd_user . read ( ) . lcd_start ( ) . bit_is_set ( ) { }
239
239
self . tear_down_send ( ) ;
240
240
}
241
241
@@ -310,9 +310,9 @@ where
310
310
self . start_write_bytes_dma ( data. as_ptr ( ) as _ , core:: mem:: size_of_val ( data) ) ?;
311
311
self . start_send ( ) ;
312
312
313
- let dma_int_raw = self . lcd_cam . lc_dma_int_raw ( ) ;
314
- // Wait until LCD_TRANS_DONE is set .
315
- while dma_int_raw . read ( ) . lcd_trans_done_int_raw ( ) . bit_is_clear ( ) { }
313
+ let lcd_user = self . lcd_cam . lcd_user ( ) ;
314
+ // Wait until LCD_START is cleared by hardware .
315
+ while lcd_user . read ( ) . lcd_start ( ) . bit_is_set ( ) { }
316
316
317
317
self . tear_down_send ( ) ;
318
318
@@ -405,13 +405,15 @@ impl<'d, TX: Tx, P> I8080<'d, TX, P> {
405
405
}
406
406
407
407
fn tear_down_send ( & mut self ) {
408
+ // This will already be cleared unless the user is trying to cancel,
409
+ // which is why this is still here.
408
410
self . lcd_cam
409
411
. lcd_user ( )
410
412
. modify ( |_, w| w. lcd_start ( ) . clear_bit ( ) ) ;
411
413
412
414
self . lcd_cam
413
415
. lc_dma_int_clr ( )
414
- . write ( |w| w. lcd_trans_done_int_clr ( ) . clear_bit ( ) ) ;
416
+ . write ( |w| w. lcd_trans_done_int_clr ( ) . set_bit ( ) ) ;
415
417
}
416
418
417
419
fn start_write_bytes_dma ( & mut self , ptr : * const u8 , len : usize ) -> Result < ( ) , DmaError > {
0 commit comments