From 36f3e8070a3084885f18c08e44dad0def0c4f975 Mon Sep 17 00:00:00 2001 From: Albin Hedman Date: Fri, 30 May 2025 23:57:24 +0200 Subject: [PATCH] Fix bad offsets --- src/gpio.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gpio.rs b/src/gpio.rs index f414d0a..fd92cc0 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -316,7 +316,7 @@ where { /// Set pin speed pub fn set_speed(&mut self, speed: Speed) { - let offset = 2 * { N }; + let offset = N; unsafe { (*Gpio::

::ptr()) @@ -338,7 +338,7 @@ where { /// Set the internal pull-up and pull-down resistor pub fn set_internal_resistor(&mut self, resistor: Pull) { - let offset = 2 * { N }; + let offset = N; let value = resistor as u8; unsafe { (*Gpio::

::ptr())