@@ -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} ;
@@ -164,7 +164,7 @@ macro_rules! gpio {
164164 }
165165
166166 impl <MODE > OutputPin for Generic <Output <MODE >> {
167- type Error = Void ;
167+ type Error = Infallible ;
168168 fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
169169 // NOTE(unsafe) atomic write to a stateless register
170170 Ok ( unsafe { ( * $GPIOX:: ptr( ) ) . bsrr. write( |w| w. bits( 1 << self . i) ) } )
@@ -177,7 +177,7 @@ macro_rules! gpio {
177177 }
178178
179179 impl <MODE > InputPin for Generic <Input <MODE >> {
180- type Error = Void ;
180+ type Error = Infallible ;
181181 fn is_high( & self ) -> Result <bool , Self :: Error > {
182182 self . is_low( ) . map( |b| !b)
183183 }
@@ -202,7 +202,7 @@ macro_rules! gpio {
202202 impl <MODE > toggleable:: Default for Generic <Output <MODE >> { }
203203
204204 impl InputPin for Generic <Output <OpenDrain >> {
205- type Error = Void ;
205+ type Error = Infallible ;
206206 fn is_high( & self ) -> Result <bool , Self :: Error > {
207207 self . is_low( ) . map( |b| !b)
208208 }
@@ -470,7 +470,7 @@ macro_rules! gpio {
470470 }
471471
472472 impl <MODE > OutputPin for $PXi<Output <MODE >> {
473- type Error = Void ;
473+ type Error = Infallible ;
474474 fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
475475 // NOTE(unsafe) atomic write to a stateless register
476476 Ok ( unsafe { ( * $GPIOX:: ptr( ) ) . bsrr. write( |w| w. bits( 1 << $i) ) } )
@@ -496,7 +496,7 @@ macro_rules! gpio {
496496 impl <MODE > toggleable:: Default for $PXi<Output <MODE >> { }
497497
498498 impl <MODE > InputPin for $PXi<Input <MODE >> {
499- type Error = Void ;
499+ type Error = Infallible ;
500500 fn is_high( & self ) -> Result <bool , Self :: Error > {
501501 self . is_low( ) . map( |b| !b)
502502 }
@@ -508,7 +508,7 @@ macro_rules! gpio {
508508 }
509509
510510 impl InputPin for $PXi<Output <OpenDrain >> {
511- type Error = Void ;
511+ type Error = Infallible ;
512512 fn is_high( & self ) -> Result <bool , Self :: Error > {
513513 self . is_low( ) . map( |b| !b)
514514 }
0 commit comments