squash! Impl ToggleableOutputPin for embassy-rp Output

Use value_xor as suggested in pull request feedback.
This commit is contained in:
Daniel Bevenius 2022-05-19 06:07:14 +02:00
parent da97944322
commit 99c2defa76

View File

@ -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);
}
}
}