mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 16:23:10 +00:00
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
|
||||
#[inline]
|
||||
pub fn toggle(&mut self) {
|
||||
if self.is_set_low() {
|
||||
self.set_high()
|
||||
} else {
|
||||
self.set_low()
|
||||
let val = 1 << self.pin.pin();
|
||||
unsafe {
|
||||
self.pin.sio_out().value_xor().write_value(val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user