@@ -77,7 +77,7 @@ macro_rules! gpio {
7777 ] ) => {
7878 /// GPIO
7979 pub mod $gpiox {
80- use void :: Void ;
80+ use core :: convert :: Infallible ;
8181 use core:: marker:: PhantomData ;
8282
8383 use crate :: hal:: digital:: v2:: { InputPin , OutputPin , StatefulOutputPin , toggleable} ;
@@ -157,7 +157,7 @@ macro_rules! gpio {
157157 }
158158
159159 impl <MODE > OutputPin for $PXx<Output <MODE >> {
160- type Error = Void ;
160+ type Error = Infallible ;
161161 fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
162162 // NOTE(unsafe) atomic write to a stateless register
163163 Ok ( unsafe { ( * $GPIOX:: ptr( ) ) . bsrr. write( |w| w. bits( 1 << self . i) ) } )
@@ -170,7 +170,7 @@ macro_rules! gpio {
170170 }
171171
172172 impl <MODE > InputPin for $PXx<Input <MODE >> {
173- type Error = Void ;
173+ type Error = Infallible ;
174174 fn is_high( & self ) -> Result <bool , Self :: Error > {
175175 self . is_low( ) . map( |b| !b)
176176 }
@@ -195,7 +195,7 @@ macro_rules! gpio {
195195 impl <MODE > toggleable:: Default for $PXx<Output <MODE >> { }
196196
197197 impl InputPin for $PXx<Output <OpenDrain >> {
198- type Error = Void ;
198+ type Error = Infallible ;
199199 fn is_high( & self ) -> Result <bool , Self :: Error > {
200200 self . is_low( ) . map( |b| !b)
201201 }
@@ -454,7 +454,7 @@ macro_rules! gpio {
454454 }
455455
456456 impl <MODE > OutputPin for $PXi<Output <MODE >> {
457- type Error = Void ;
457+ type Error = Infallible ;
458458 fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
459459 // NOTE(unsafe) atomic write to a stateless register
460460 Ok ( unsafe { ( * $GPIOX:: ptr( ) ) . bsrr. write( |w| w. bits( 1 << $i) ) } )
@@ -480,7 +480,7 @@ macro_rules! gpio {
480480 impl <MODE > toggleable:: Default for $PXi<Output <MODE >> { }
481481
482482 impl <MODE > OutputPin for $PXi<Alternate <MODE >> {
483- type Error = Void ;
483+ type Error = Infallible ;
484484 fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
485485 // NOTE(unsafe) atomic write to a stateless register
486486 Ok ( unsafe { ( * $GPIOX:: ptr( ) ) . bsrr. write( |w| w. bits( 1 << $i) ) } )
@@ -504,7 +504,7 @@ macro_rules! gpio {
504504 }
505505
506506 impl <MODE > InputPin for $PXi<Input <MODE >> {
507- type Error = Void ;
507+ type Error = Infallible ;
508508 fn is_high( & self ) -> Result <bool , Self :: Error > {
509509 self . is_low( ) . map( |b| !b)
510510 }
@@ -516,7 +516,7 @@ macro_rules! gpio {
516516 }
517517
518518 impl InputPin for $PXi<Output <OpenDrain >> {
519- type Error = Void ;
519+ type Error = Infallible ;
520520 fn is_high( & self ) -> Result <bool , Self :: Error > {
521521 self . is_low( ) . map( |b| !b)
522522 }
0 commit comments