@@ -115,14 +115,11 @@ pub struct AF14;
115
115
/// Alternate function 15 (type state)
116
116
pub struct AF15 ;
117
117
118
- // Using SCREAMING_SNAKE_CASE to be consistent with other HALs
119
- // see 59b2740 and #125 for motivation
120
- #[ allow( non_camel_case_types) ]
121
118
#[ derive( Debug , PartialEq ) ]
122
119
pub enum Edge {
123
- RISING ,
124
- FALLING ,
125
- RISING_FALLING ,
120
+ Rising ,
121
+ Falling ,
122
+ RisingFalling ,
126
123
}
127
124
128
125
/// External Interrupt Pin
@@ -354,15 +351,15 @@ macro_rules! gpio {
354
351
/// Generate interrupt on rising edge, falling edge or both
355
352
fn trigger_on_edge( & mut self , exti: & mut EXTI , edge: Edge ) {
356
353
match edge {
357
- Edge :: RISING => {
354
+ Edge :: Rising => {
358
355
exti. rtsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << self . i) ) } ) ;
359
356
exti. ftsr1. modify( |r, w| unsafe { w. bits( r. bits( ) & !( 1 << self . i) ) } ) ;
360
357
} ,
361
- Edge :: FALLING => {
358
+ Edge :: Falling => {
362
359
exti. ftsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << self . i) ) } ) ;
363
360
exti. rtsr1. modify( |r, w| unsafe { w. bits( r. bits( ) & !( 1 << self . i) ) } ) ;
364
361
} ,
365
- Edge :: RISING_FALLING => {
362
+ Edge :: RisingFalling => {
366
363
exti. rtsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << self . i) ) } ) ;
367
364
exti. ftsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << self . i) ) } ) ;
368
365
}
@@ -699,15 +696,15 @@ macro_rules! gpio {
699
696
/// Generate interrupt on rising edge, falling edge or both
700
697
fn trigger_on_edge( & mut self , exti: & mut EXTI , edge: Edge ) {
701
698
match edge {
702
- Edge :: RISING => {
699
+ Edge :: Rising => {
703
700
exti. rtsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << $i) ) } ) ;
704
701
exti. ftsr1. modify( |r, w| unsafe { w. bits( r. bits( ) & !( 1 << $i) ) } ) ;
705
702
} ,
706
- Edge :: FALLING => {
703
+ Edge :: Falling => {
707
704
exti. ftsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << $i) ) } ) ;
708
705
exti. rtsr1. modify( |r, w| unsafe { w. bits( r. bits( ) & !( 1 << $i) ) } ) ;
709
706
} ,
710
- Edge :: RISING_FALLING => {
707
+ Edge :: RisingFalling => {
711
708
exti. rtsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << $i) ) } ) ;
712
709
exti. ftsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << $i) ) } ) ;
713
710
}
0 commit comments