@@ -79,12 +79,6 @@ pub enum Port {
79
79
PH ,
80
80
}
81
81
82
- /// Error type used by the GPIO trait impls.
83
- ///
84
- /// GPIO operations cannot fail, so this is uninhabited.
85
- #[ derive( Debug ) ]
86
- pub enum Error { }
87
-
88
82
macro_rules! gpio {
89
83
( $GPIOX: ident, $gpiox: ident, $iopxenr: ident, $PXx: ident, [
90
84
$( $PXi: ident: ( $pxi: ident, $i: expr, $MODE: ty) , ) +
@@ -144,7 +138,7 @@ macro_rules! gpio {
144
138
}
145
139
146
140
impl <MODE > OutputPin for $PXx<Output <MODE >> {
147
- type Error = super :: Error ;
141
+ type Error = void :: Void ;
148
142
149
143
fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
150
144
// NOTE(unsafe) atomic write to a stateless register
@@ -175,7 +169,7 @@ macro_rules! gpio {
175
169
impl <MODE > toggleable:: Default for $PXx<Output <MODE >> { }
176
170
177
171
impl <MODE > InputPin for $PXx<Output <MODE >> {
178
- type Error = super :: Error ;
172
+ type Error = void :: Void ;
179
173
180
174
fn is_high( & self ) -> Result <bool , Self :: Error > {
181
175
let is_high = !self . is_low( ) ?;
@@ -190,7 +184,7 @@ macro_rules! gpio {
190
184
}
191
185
192
186
impl <MODE > InputPin for $PXx<Input <MODE >> {
193
- type Error = super :: Error ;
187
+ type Error = void :: Void ;
194
188
195
189
fn is_high( & self ) -> Result <bool , Self :: Error > {
196
190
let is_high = !self . is_low( ) ?;
@@ -385,7 +379,7 @@ macro_rules! gpio {
385
379
}
386
380
387
381
impl <MODE > OutputPin for $PXi<Output <MODE >> {
388
- type Error = super :: Error ;
382
+ type Error = void :: Void ;
389
383
390
384
fn set_high( & mut self ) -> Result <( ) , Self :: Error > {
391
385
// NOTE(unsafe) atomic write to a stateless register
@@ -417,7 +411,7 @@ macro_rules! gpio {
417
411
impl <MODE > toggleable:: Default for $PXi<Output <MODE >> { }
418
412
419
413
impl <MODE > InputPin for $PXi<Output <MODE >> {
420
- type Error = super :: Error ;
414
+ type Error = void :: Void ;
421
415
422
416
fn is_high( & self ) -> Result <bool , Self :: Error > {
423
417
let is_high = !self . is_low( ) ?;
@@ -445,8 +439,7 @@ macro_rules! gpio {
445
439
}
446
440
447
441
impl <MODE > InputPin for $PXi<Input <MODE >> {
448
-
449
- type Error = super :: Error ;
442
+ type Error = void:: Void ;
450
443
451
444
fn is_high( & self ) -> Result <bool , Self :: Error > {
452
445
let is_high = !self . is_low( ) ?;
0 commit comments