@@ -108,7 +108,7 @@ unsafe fn handle_gpiote_interrupt() {
108
108
109
109
for i in 0 ..CHANNEL_COUNT {
110
110
if g. events_in [ i] . read ( ) . bits ( ) != 0 {
111
- g. intenclr . write ( |w| unsafe { w. bits ( 1 << i) } ) ;
111
+ g. intenclr . write ( |w| w. bits ( 1 << i) ) ;
112
112
CHANNEL_WAKERS [ i] . wake ( ) ;
113
113
}
114
114
}
@@ -481,102 +481,72 @@ mod eh1 {
481
481
}
482
482
}
483
483
484
- #[ cfg( all( feature = "unstable-traits" , feature = "nightly" ) ) ]
485
- mod eh1a {
486
- use super :: * ;
487
- use futures:: FutureExt ;
484
+ cfg_if:: cfg_if! {
485
+ if #[ cfg( all( feature = "unstable-traits" , feature = "nightly" ) ) ] {
486
+ use futures:: FutureExt ;
488
487
489
- impl < ' d , T : GpioPin > embedded_hal_async:: digital:: Wait for Input < ' d , T > {
490
- type WaitForHighFuture < ' a >
491
- where
492
- Self : ' a ,
493
- = impl Future < Output = Result < ( ) , Self :: Error > > + ' a ;
488
+ impl <' d, T : GpioPin > embedded_hal_async:: digital:: Wait for Input <' d, T > {
489
+ type WaitForHighFuture <' a> = impl Future <Output = Result <( ) , Self :: Error >> + ' a where Self : ' a;
494
490
495
- fn wait_for_high < ' a > ( & ' a mut self ) -> Self :: WaitForHighFuture < ' a > {
496
- self . wait_for_high ( ) . map ( Ok )
497
- }
491
+ fn wait_for_high<' a>( & ' a mut self ) -> Self :: WaitForHighFuture <' a> {
492
+ self . wait_for_high( ) . map( Ok )
493
+ }
498
494
499
- type WaitForLowFuture < ' a >
500
- where
501
- Self : ' a ,
502
- = impl Future < Output = Result < ( ) , Self :: Error > > + ' a ;
495
+ type WaitForLowFuture <' a> = impl Future <Output = Result <( ) , Self :: Error >> + ' a where Self : ' a;
503
496
504
- fn wait_for_low < ' a > ( & ' a mut self ) -> Self :: WaitForLowFuture < ' a > {
505
- self . wait_for_low ( ) . map ( Ok )
506
- }
497
+ fn wait_for_low<' a>( & ' a mut self ) -> Self :: WaitForLowFuture <' a> {
498
+ self . wait_for_low( ) . map( Ok )
499
+ }
507
500
508
- type WaitForRisingEdgeFuture < ' a >
509
- where
510
- Self : ' a ,
511
- = impl Future < Output = Result < ( ) , Self :: Error > > + ' a ;
501
+ type WaitForRisingEdgeFuture <' a> = impl Future <Output = Result <( ) , Self :: Error >> + ' a where Self : ' a;
512
502
513
- fn wait_for_rising_edge < ' a > ( & ' a mut self ) -> Self :: WaitForRisingEdgeFuture < ' a > {
514
- self . wait_for_rising_edge ( ) . map ( Ok )
515
- }
503
+ fn wait_for_rising_edge<' a>( & ' a mut self ) -> Self :: WaitForRisingEdgeFuture <' a> {
504
+ self . wait_for_rising_edge( ) . map( Ok )
505
+ }
516
506
517
- type WaitForFallingEdgeFuture < ' a >
518
- where
519
- Self : ' a ,
520
- = impl Future < Output = Result < ( ) , Self :: Error > > + ' a ;
507
+ type WaitForFallingEdgeFuture <' a> = impl Future <Output = Result <( ) , Self :: Error >> + ' a where Self : ' a;
521
508
522
- fn wait_for_falling_edge < ' a > ( & ' a mut self ) -> Self :: WaitForFallingEdgeFuture < ' a > {
523
- self . wait_for_falling_edge ( ) . map ( Ok )
524
- }
509
+ fn wait_for_falling_edge<' a>( & ' a mut self ) -> Self :: WaitForFallingEdgeFuture <' a> {
510
+ self . wait_for_falling_edge( ) . map( Ok )
511
+ }
525
512
526
- type WaitForAnyEdgeFuture < ' a >
527
- where
528
- Self : ' a ,
529
- = impl Future < Output = Result < ( ) , Self :: Error > > + ' a ;
513
+ type WaitForAnyEdgeFuture <' a> = impl Future <Output = Result <( ) , Self :: Error >> + ' a where Self : ' a;
530
514
531
- fn wait_for_any_edge < ' a > ( & ' a mut self ) -> Self :: WaitForAnyEdgeFuture < ' a > {
532
- self . wait_for_any_edge ( ) . map ( Ok )
515
+ fn wait_for_any_edge<' a>( & ' a mut self ) -> Self :: WaitForAnyEdgeFuture <' a> {
516
+ self . wait_for_any_edge( ) . map( Ok )
517
+ }
533
518
}
534
- }
535
519
536
- impl < ' d , T : GpioPin > embedded_hal_async:: digital:: Wait for Flex < ' d , T > {
537
- type WaitForHighFuture < ' a >
538
- where
539
- Self : ' a ,
540
- = impl Future < Output = Result < ( ) , Self :: Error > > + ' a ;
520
+ impl <' d, T : GpioPin > embedded_hal_async:: digital:: Wait for Flex <' d, T > {
521
+ type WaitForHighFuture <' a> = impl Future <Output = Result <( ) , Self :: Error >> + ' a where Self : ' a;
541
522
542
- fn wait_for_high < ' a > ( & ' a mut self ) -> Self :: WaitForHighFuture < ' a > {
543
- self . wait_for_high ( ) . map ( Ok )
544
- }
523
+ fn wait_for_high<' a>( & ' a mut self ) -> Self :: WaitForHighFuture <' a> {
524
+ self . wait_for_high( ) . map( Ok )
525
+ }
545
526
546
- type WaitForLowFuture < ' a >
547
- where
548
- Self : ' a ,
549
- = impl Future < Output = Result < ( ) , Self :: Error > > + ' a ;
527
+ type WaitForLowFuture <' a> = impl Future <Output = Result <( ) , Self :: Error >> + ' a where Self : ' a;
550
528
551
- fn wait_for_low < ' a > ( & ' a mut self ) -> Self :: WaitForLowFuture < ' a > {
552
- self . wait_for_low ( ) . map ( Ok )
553
- }
529
+ fn wait_for_low<' a>( & ' a mut self ) -> Self :: WaitForLowFuture <' a> {
530
+ self . wait_for_low( ) . map( Ok )
531
+ }
554
532
555
- type WaitForRisingEdgeFuture < ' a >
556
- where
557
- Self : ' a ,
558
- = impl Future < Output = Result < ( ) , Self :: Error > > + ' a ;
533
+ type WaitForRisingEdgeFuture <' a> = impl Future <Output = Result <( ) , Self :: Error >> + ' a where Self : ' a;
559
534
560
- fn wait_for_rising_edge < ' a > ( & ' a mut self ) -> Self :: WaitForRisingEdgeFuture < ' a > {
561
- self . wait_for_rising_edge ( ) . map ( Ok )
562
- }
535
+ fn wait_for_rising_edge<' a>( & ' a mut self ) -> Self :: WaitForRisingEdgeFuture <' a> {
536
+ self . wait_for_rising_edge( ) . map( Ok )
537
+ }
563
538
564
- type WaitForFallingEdgeFuture < ' a >
565
- where
566
- Self : ' a ,
567
- = impl Future < Output = Result < ( ) , Self :: Error > > + ' a ;
539
+ type WaitForFallingEdgeFuture <' a> = impl Future <Output = Result <( ) , Self :: Error >> + ' a where Self : ' a;
568
540
569
- fn wait_for_falling_edge < ' a > ( & ' a mut self ) -> Self :: WaitForFallingEdgeFuture < ' a > {
570
- self . wait_for_falling_edge ( ) . map ( Ok )
571
- }
541
+ fn wait_for_falling_edge<' a>( & ' a mut self ) -> Self :: WaitForFallingEdgeFuture <' a> {
542
+ self . wait_for_falling_edge( ) . map( Ok )
543
+ }
572
544
573
- type WaitForAnyEdgeFuture < ' a >
574
- where
575
- Self : ' a ,
576
- = impl Future < Output = Result < ( ) , Self :: Error > > + ' a ;
545
+ type WaitForAnyEdgeFuture <' a> = impl Future <Output = Result <( ) , Self :: Error >> + ' a where Self : ' a;
577
546
578
- fn wait_for_any_edge < ' a > ( & ' a mut self ) -> Self :: WaitForAnyEdgeFuture < ' a > {
579
- self . wait_for_any_edge ( ) . map ( Ok )
547
+ fn wait_for_any_edge<' a>( & ' a mut self ) -> Self :: WaitForAnyEdgeFuture <' a> {
548
+ self . wait_for_any_edge( ) . map( Ok )
549
+ }
580
550
}
581
551
}
582
552
}
0 commit comments