@@ -626,6 +626,7 @@ where
626
626
Edge :: Falling => ( false as u32 , true as u32 ) ,
627
627
Edge :: RisingFalling => ( true as u32 , true as u32 ) ,
628
628
} ;
629
+ // SAFETY: Unguarded write to the register, but behind a &mut
629
630
unsafe {
630
631
modify_at ! ( reg_for_cpu!( exti, rtsr) , BITWIDTH , index, rise) ;
631
632
modify_at ! ( reg_for_cpu!( exti, ftsr) , BITWIDTH , index, fall) ;
@@ -644,6 +645,7 @@ where
644
645
645
646
let index = self . index . index ( ) ;
646
647
let value = u32:: from ( enable) ;
648
+ // SAFETY: Unguarded write to the register, but behind a &mut
647
649
unsafe { modify_at ! ( reg_for_cpu!( exti, imr) , BITWIDTH , index, value) } ;
648
650
}
649
651
@@ -659,11 +661,13 @@ where
659
661
660
662
/// Clear the interrupt pending bit for this pin
661
663
pub fn clear_interrupt ( & mut self ) {
664
+ // SAFETY: Atomic write to register without side-effects.
662
665
unsafe { reg_for_cpu ! ( ( * EXTI :: ptr( ) ) , pr) . write ( |w| w. bits ( 1 << self . index . index ( ) ) ) } ;
663
666
}
664
667
665
668
/// Reads the interrupt pending bit for this pin
666
669
pub fn is_interrupt_pending ( & self ) -> bool {
670
+ // SAFETY: Atomic write to register without side-effects.
667
671
unsafe { reg_for_cpu ! ( ( * EXTI :: ptr( ) ) , pr) . read ( ) . bits ( ) & ( 1 << self . index . index ( ) ) != 0 }
668
672
}
669
673
}
0 commit comments