@@ -26,12 +26,6 @@ pub enum Event {
26
26
TransferComplete ,
27
27
}
28
28
29
- #[ derive( Clone , Copy , PartialEq ) ]
30
- pub enum Half {
31
- First ,
32
- Second ,
33
- }
34
-
35
29
pub trait CharacterMatch {
36
30
/// Checks to see if the peripheral has detected a character match and
37
31
/// clears the flag
@@ -535,7 +529,7 @@ macro_rules! dma {
535
529
use core:: ptr;
536
530
use stable_deref_trait:: StableDeref ;
537
531
538
- use crate :: dma:: { CircBuffer , FrameReader , FrameSender , DMAFrame , DmaExt , Error , Event , Half , Transfer , W , R , RW , RxDma , RxTxDma , TxDma , TransferPayload } ;
532
+ use crate :: dma:: { CircBuffer , FrameReader , FrameSender , DMAFrame , DmaExt , Error , Event , Transfer , W , R , RW , RxDma , RxTxDma , TxDma , TransferPayload } ;
539
533
use crate :: rcc:: AHB1 ;
540
534
541
535
#[ allow( clippy:: manual_non_exhaustive) ]
@@ -956,7 +950,10 @@ macro_rules! dma {
956
950
// conditions first.
957
951
// TODO When is the half-complete flag written exactly? Especially for
958
952
// odd buffer capacities.
959
- let overrun = self . passed_mark( self . write_previous, write_current, self . read_index, capacity) || ( transfer_complete_flag && !self . passed_mark( self . write_previous, write_current, 0 , capacity) ) || ( half_complete_flag && !self . passed_mark( self . write_previous, write_current, capacity/2 , capacity) ) ;
953
+ let overrun =
954
+ self . passed_mark( self . write_previous, write_current, self . read_index, capacity)
955
+ || ( transfer_complete_flag && !self . passed_mark( self . write_previous, write_current, 0 , capacity) )
956
+ || ( half_complete_flag && !self . passed_mark( self . write_previous, write_current, capacity/2 , capacity) ) ;
960
957
self . write_previous = write_current;
961
958
if overrun {
962
959
self . read_index = write_current;
0 commit comments