squash! Impl ToggleableOutputPin for embassy-rp Output
Use value_xor as suggested in pull request feedback.
This commit is contained in:
parent
da97944322
commit
99c2defa76
@ -135,10 +135,9 @@ impl<'d, T: Pin> Output<'d, T> {
|
|||||||
/// Toggle pin output
|
/// Toggle pin output
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn toggle(&mut self) {
|
pub fn toggle(&mut self) {
|
||||||
if self.is_set_low() {
|
let val = 1 << self.pin.pin();
|
||||||
self.set_high()
|
unsafe {
|
||||||
} else {
|
self.pin.sio_out().value_xor().write_value(val);
|
||||||
self.set_low()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user