2020-11-08 06:04 AM
Im using external interrupts on an STM32L412. I want the interrupt to run as fast as possible so I'm not using the HAL to turn off the request, rather I am writing directly to EXTI -> PR1, which needs to be written high to turn off the interrupt, but if I write for example
EXTI -> PR1 |= 1<<10;
it turns off the other interrupts.
EXTI->PR1 &=1<<10;
doesn't turn anything off.
How can I write this without using HAL?
2020-11-08 06:36 AM
That should clear the bit. If it doesn't, perhaps it's getting triggered again. You don't need to modify, you can just write the individual bit to clear it.
EXTI->PR1 = 1<<10;
2020-11-08 10:23 AM
You MUST write only the bit you want to clear.
If you use a read-modify-write of the PR1 register you will clear all the interrupt already present.
Have a look the the ref man. The PR bits are of rc_w1 type: Software can read as well as clear this bit by writing 1. Writing ‘0’ has
no effect on the bit value.