diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs index 596dd64c..aa3c3a64 100644 --- a/embassy-rp/src/gpio.rs +++ b/embassy-rp/src/gpio.rs @@ -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); } } }