@@ -115,14 +115,11 @@ pub struct AF14;
115115/// Alternate function 15 (type state)
116116pub struct AF15 ;
117117
118- // Using SCREAMING_SNAKE_CASE to be consistent with other HALs
119- // see 59b2740 and #125 for motivation
120- #[ allow( non_camel_case_types) ]
121118#[ derive( Debug , PartialEq ) ]
122119pub enum Edge {
123- RISING ,
124- FALLING ,
125- RISING_FALLING ,
120+ Rising ,
121+ Falling ,
122+ RisingFalling ,
126123}
127124
128125/// External Interrupt Pin
@@ -354,15 +351,15 @@ macro_rules! gpio {
354351 /// Generate interrupt on rising edge, falling edge or both
355352 fn trigger_on_edge( & mut self , exti: & mut EXTI , edge: Edge ) {
356353 match edge {
357- Edge :: RISING => {
354+ Edge :: Rising => {
358355 exti. rtsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << self . i) ) } ) ;
359356 exti. ftsr1. modify( |r, w| unsafe { w. bits( r. bits( ) & !( 1 << self . i) ) } ) ;
360357 } ,
361- Edge :: FALLING => {
358+ Edge :: Falling => {
362359 exti. ftsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << self . i) ) } ) ;
363360 exti. rtsr1. modify( |r, w| unsafe { w. bits( r. bits( ) & !( 1 << self . i) ) } ) ;
364361 } ,
365- Edge :: RISING_FALLING => {
362+ Edge :: RisingFalling => {
366363 exti. rtsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << self . i) ) } ) ;
367364 exti. ftsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << self . i) ) } ) ;
368365 }
@@ -699,15 +696,15 @@ macro_rules! gpio {
699696 /// Generate interrupt on rising edge, falling edge or both
700697 fn trigger_on_edge( & mut self , exti: & mut EXTI , edge: Edge ) {
701698 match edge {
702- Edge :: RISING => {
699+ Edge :: Rising => {
703700 exti. rtsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << $i) ) } ) ;
704701 exti. ftsr1. modify( |r, w| unsafe { w. bits( r. bits( ) & !( 1 << $i) ) } ) ;
705702 } ,
706- Edge :: FALLING => {
703+ Edge :: Falling => {
707704 exti. ftsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << $i) ) } ) ;
708705 exti. rtsr1. modify( |r, w| unsafe { w. bits( r. bits( ) & !( 1 << $i) ) } ) ;
709706 } ,
710- Edge :: RISING_FALLING => {
707+ Edge :: RisingFalling => {
711708 exti. rtsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << $i) ) } ) ;
712709 exti. ftsr1. modify( |r, w| unsafe { w. bits( r. bits( ) | ( 1 << $i) ) } ) ;
713710 }
0 commit comments