Skip to content

Commit 5549621

Browse files
authored
Fix bad offsets (#54)
Found out that the offset for setting the pull up/down resistor is wrong during #52
1 parent 199b3c2 commit 5549621

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gpio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ where
316316
{
317317
/// Set pin speed
318318
pub fn set_speed(&mut self, speed: Speed) {
319-
let offset = 2 * { N };
319+
let offset = N;
320320

321321
unsafe {
322322
(*Gpio::<P>::ptr())
@@ -338,7 +338,7 @@ where
338338
{
339339
/// Set the internal pull-up and pull-down resistor
340340
pub fn set_internal_resistor(&mut self, resistor: Pull) {
341-
let offset = 2 * { N };
341+
let offset = N;
342342
let value = resistor as u8;
343343
unsafe {
344344
(*Gpio::<P>::ptr())

0 commit comments

Comments
 (0)