Skip to content

Commit 10de490

Browse files
careyk007hannobraun
authored andcommitted
convert digital::v2 errors to void::Void
1 parent 48bcc0c commit 10de490

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

nrf52-hal-common/src/gpio.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ use crate::target::P0;
6363
use crate::target::{ P1 };
6464

6565
use crate::hal::digital::v2::{OutputPin, StatefulOutputPin, InputPin};
66+
use void::Void;
6667

6768
impl<MODE> Pin<MODE> {
6869
/// Convert the pin to be a floating input
@@ -220,7 +221,7 @@ impl<MODE> Pin<MODE> {
220221
}
221222

222223
impl<MODE> InputPin for Pin<Input<MODE>> {
223-
type Error = ();
224+
type Error = Void;
224225

225226
fn is_high(&self) -> Result<bool, Self::Error> {
226227
self.is_low().map(|v| !v)
@@ -239,7 +240,7 @@ impl<MODE> InputPin for Pin<Input<MODE>> {
239240
}
240241

241242
impl<MODE> OutputPin for Pin<Output<MODE>> {
242-
type Error = ();
243+
type Error = Void;
243244

244245
/// Set the output as high
245246
fn set_high(&mut self) -> Result<(), Self::Error> {
@@ -356,7 +357,7 @@ macro_rules! gpio {
356357

357358
use crate::target;
358359
use crate::hal::digital::v2::{OutputPin, StatefulOutputPin, InputPin};
359-
use core::convert::Infallible;
360+
use void::Void;
360361

361362

362363

@@ -508,7 +509,7 @@ macro_rules! gpio {
508509
}
509510

510511
impl<MODE> InputPin for $PXi<Input<MODE>> {
511-
type Error = Infallible;
512+
type Error = Void;
512513

513514
fn is_high(&self) -> Result<bool, Self::Error> {
514515
self.is_low().map(|v| !v)
@@ -520,7 +521,7 @@ macro_rules! gpio {
520521
}
521522

522523
impl<MODE> OutputPin for $PXi<Output<MODE>> {
523-
type Error = Infallible;
524+
type Error = Void;
524525

525526
/// Set the output as high
526527
fn set_high(&mut self) -> Result<(), Self::Error> {

0 commit comments

Comments
 (0)