Skip to content

Commit 1df3703

Browse files
committed
fix gpio mode change
1 parent 101cdf4 commit 1df3703

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/gpio.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ where
845845
}
846846
8..=15 => {
847847
gpio.crh()
848-
.modify(|_, w| unsafe { w.mode(N - 16).bits(speed as u8) });
848+
.modify(|_, w| unsafe { w.mode(N - 8).bits(speed as u8) });
849849
}
850850
_ => unreachable!(),
851851
}
@@ -979,8 +979,8 @@ where
979979
}
980980
8..=15 => {
981981
gpio.crh().modify(|_, w| unsafe {
982-
w.mode(N - 16).bits(MODE::MODE as u8);
983-
w.cnf(N - 16).bits(MODE::CNF as u8)
982+
w.mode(N - 8).bits(MODE::MODE as u8);
983+
w.cnf(N - 8).bits(MODE::CNF as u8)
984984
});
985985
}
986986
_ => unreachable!(),

0 commit comments

Comments
 (0)