David-OConnor / stm32-hal

This library provides access to STM32 peripherals in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GPIO edge interrupts incorrect

762SPR opened this issue · comments

GPIO Pin.enable_interrupt() seems to configure the RTSR1 and FTSR1 registers wrong on a L4

Setting it to FALLING results in:
RTSR1 = 0
FTSR1 = 0

Setting it to RISING results in:
RTSR1 = 1
FTSR1 = 1

Setting it to Either results in:
RTSR1 = 1
FTSR1 = 0

I believe it is because

exti.ftsr1.modify(|_, w| w.[<tr $num>]().bit(!$falling));

Should be

exti.ftsr1.modify(|_, w| w.[<tr $num>]().bit($falling));

But I don't know much about macros so could be wrong! 😅

THANK YOU for your work on this HAL!!!