mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-01-27 03:26:36 +11:00
Block input reads on Unknown state
This commit is contained in:
parent
2e5c1fc0e3
commit
3536604b9e
1 changed files with 16 additions and 10 deletions
|
@ -154,8 +154,9 @@ macro_rules! gpio {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Don't allow Unknown since we need to fix up the pad at least
|
macro_rules! impl_input_for {
|
||||||
impl<MODE> InputPin for $PXi<MODE> {
|
($MODE:ident) => {
|
||||||
|
impl InputPin for $PXi<$MODE> {
|
||||||
type Error = Infallible;
|
type Error = Infallible;
|
||||||
|
|
||||||
fn is_low(&self) -> Result<bool, Self::Error> {
|
fn is_low(&self) -> Result<bool, Self::Error> {
|
||||||
|
@ -168,6 +169,11 @@ macro_rules! gpio {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// Not allowed for Unknown since we don't know what state the pad is in
|
||||||
|
impl_input_for!(Input);
|
||||||
|
impl_input_for!(Output);
|
||||||
|
|
||||||
impl $PXi<Input> {
|
impl $PXi<Input> {
|
||||||
pub fn pull_high(&mut self) {
|
pub fn pull_high(&mut self) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue