@@ -77,7 +77,7 @@ macro_rules! gpio {
77
77
] ) => {
78
78
/// GPIO
79
79
pub mod $gpiox {
80
- use void :: Void ;
80
+ use core :: convert :: Infallible ;
81
81
use core:: marker:: PhantomData ;
82
82
83
83
use crate :: hal:: digital:: v2:: { InputPin , OutputPin , StatefulOutputPin , toggleable} ;
@@ -157,7 +157,7 @@ macro_rules! gpio {
157
157
}
158
158
159
159
impl <MODE > OutputPin for $PXx<Output <MODE >> {
160
- type Error = Void ;
160
+ type Error = Infallible ;
161
161
fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
162
162
// NOTE(unsafe) atomic write to a stateless register
163
163
Ok ( unsafe { ( * $GPIOX:: ptr( ) ) . bsrr. write( |w| w. bits( 1 << self . i) ) } )
@@ -170,7 +170,7 @@ macro_rules! gpio {
170
170
}
171
171
172
172
impl <MODE > InputPin for $PXx<Input <MODE >> {
173
- type Error = Void ;
173
+ type Error = Infallible ;
174
174
fn is_high( & self ) -> Result <bool , Self :: Error > {
175
175
self . is_low( ) . map( |b| !b)
176
176
}
@@ -195,7 +195,7 @@ macro_rules! gpio {
195
195
impl <MODE > toggleable:: Default for $PXx<Output <MODE >> { }
196
196
197
197
impl InputPin for $PXx<Output <OpenDrain >> {
198
- type Error = Void ;
198
+ type Error = Infallible ;
199
199
fn is_high( & self ) -> Result <bool , Self :: Error > {
200
200
self . is_low( ) . map( |b| !b)
201
201
}
@@ -454,7 +454,7 @@ macro_rules! gpio {
454
454
}
455
455
456
456
impl <MODE > OutputPin for $PXi<Output <MODE >> {
457
- type Error = Void ;
457
+ type Error = Infallible ;
458
458
fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
459
459
// NOTE(unsafe) atomic write to a stateless register
460
460
Ok ( unsafe { ( * $GPIOX:: ptr( ) ) . bsrr. write( |w| w. bits( 1 << $i) ) } )
@@ -480,7 +480,7 @@ macro_rules! gpio {
480
480
impl <MODE > toggleable:: Default for $PXi<Output <MODE >> { }
481
481
482
482
impl <MODE > OutputPin for $PXi<Alternate <MODE >> {
483
- type Error = Void ;
483
+ type Error = Infallible ;
484
484
fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
485
485
// NOTE(unsafe) atomic write to a stateless register
486
486
Ok ( unsafe { ( * $GPIOX:: ptr( ) ) . bsrr. write( |w| w. bits( 1 << $i) ) } )
@@ -504,7 +504,7 @@ macro_rules! gpio {
504
504
}
505
505
506
506
impl <MODE > InputPin for $PXi<Input <MODE >> {
507
- type Error = Void ;
507
+ type Error = Infallible ;
508
508
fn is_high( & self ) -> Result <bool , Self :: Error > {
509
509
self . is_low( ) . map( |b| !b)
510
510
}
@@ -516,7 +516,7 @@ macro_rules! gpio {
516
516
}
517
517
518
518
impl InputPin for $PXi<Output <OpenDrain >> {
519
- type Error = Void ;
519
+ type Error = Infallible ;
520
520
fn is_high( & self ) -> Result <bool , Self :: Error > {
521
521
self . is_low( ) . map( |b| !b)
522
522
}
0 commit comments