mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
squash! Implement Output::is_set_low for embassy-rp
Add check for the bit of the current pin.
This commit is contained in:
parent
6d4a49bca8
commit
0bb428dcc0
@ -128,7 +128,8 @@ impl<'d, T: Pin> Output<'d, T> {
|
||||
/// Is the output pin set as low?
|
||||
pub fn is_set_low(&self) -> bool {
|
||||
// Reading from SIO: GPIO_OUT gives the last value written.
|
||||
unsafe { self.pin.sio_out().value().read() == 0 }
|
||||
let val = 1 << self.pin.pin();
|
||||
unsafe { (self.pin.sio_out().value().read() & val) == 0 }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user