From 488e3224783abe07b2be8046642fd9b81f5714b9 Mon Sep 17 00:00:00 2001 From: Simon Berg Date: Fri, 9 Dec 2022 20:30:17 +0100 Subject: [PATCH] Clear unused pulls in set_pull. --- embassy-rp/src/gpio.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs index 315cd2ac..ec05de61 100644 --- a/embassy-rp/src/gpio.rs +++ b/embassy-rp/src/gpio.rs @@ -476,11 +476,13 @@ impl<'d, T: Pin> Flex<'d, T> { unsafe { self.pin.pad_ctrl().modify(|w| { w.set_ie(true); - match pull { - Pull::Up => w.set_pue(true), - Pull::Down => w.set_pde(true), - Pull::None => {} - } + let (pu, pd) = match pull { + Pull::Up => (true, false), + Pull::Down => (false, true), + Pull::None => (false, false), + }; + w.set_pue(pu); + w.set_pde(pd); }); } }