Skip to content

Commit 4bb60ce

Browse files
authored
Fix mut
1 parent fece9b0 commit 4bb60ce

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

embassy-stm32/src/exti.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,14 @@ impl<'a> ExtiInputFuture<'a> {
269269
critical_section::with(|_| {
270270
let pin = pin as usize;
271271
#[cfg(exti_n6)]
272-
{
272+
let port = {
273273
const STM32_PORTI: PinNumber = 0x8;
274274
const STM32_PORTN: PinNumber = 0xD;
275-
if (port >= STM32_PORTN) {
276-
// Ports N and above (starting index 13) use value 8 and higher
277-
port = port - (STM32_PORTN - STM32_PORTI);
275+
// Ports N and above (starting index 13) use value 8 and higher
276+
if port >= STM32_PORTN {
277+
port - (STM32_PORTN - STM32_PORTI)
278+
} else {
279+
port
278280
}
279281
}
280282
exticr_regs().exticr(pin / 4).modify(|w| w.set_exti(pin % 4, port));

0 commit comments

Comments
 (0)