File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -361,6 +361,15 @@ fn config_channel_task_pin<P: GpioteOutputPin>(
361361 TaskOutPolarity :: Clear => w. polarity ( ) . hi_to_lo ( ) ,
362362 TaskOutPolarity :: Toggle => w. polarity ( ) . toggle ( ) ,
363363 } ;
364+
365+ #[ cfg( any( feature = "52833" , feature = "52840" ) ) ]
366+ {
367+ match pin. port ( ) {
368+ Port :: Port0 => w. port ( ) . clear_bit ( ) ,
369+ Port :: Port1 => w. port ( ) . set_bit ( ) ,
370+ } ;
371+ }
372+
364373 unsafe { w. psel ( ) . bits ( pin. pin ( ) ) }
365374 } ) ;
366375}
@@ -421,16 +430,23 @@ impl GpioteInputPin for Pin<Input<Floating>> {
421430/// Trait to represent task output pin.
422431pub trait GpioteOutputPin {
423432 fn pin ( & self ) -> u8 ;
433+ fn port ( & self ) -> Port ;
424434}
425435
426436impl GpioteOutputPin for Pin < Output < OpenDrain > > {
427437 fn pin ( & self ) -> u8 {
428438 self . pin ( )
429439 }
440+ fn port ( & self ) -> Port {
441+ self . port ( )
442+ }
430443}
431444
432445impl GpioteOutputPin for Pin < Output < PushPull > > {
433446 fn pin ( & self ) -> u8 {
434447 self . pin ( )
435448 }
449+ fn port ( & self ) -> Port {
450+ self . port ( )
451+ }
436452}
You can’t perform that action at this time.
0 commit comments