| ... | ... | @@ -55,7 +55,7 @@ EXTI->FTSR |= EXTI_FTSR_TR4; |
|
|
|
// Trigger the interrupt on a rising edge of line 4
|
|
|
|
// EXTI->RTSR |= EXTI_RTSR_TR4;
|
|
|
|
|
|
|
|
EXTI->PR |= EXTI_PR_PR4; // Reset pending register of line 4
|
|
|
|
EXTI->PR = EXTI_PR_PR4; // Reset pending register of line 4
|
|
|
|
|
|
|
|
// Assign the interrupt of line 4 to GPIOC (=> PC4)
|
|
|
|
// this sets the SYSCFG->EXTICR2 register to 0010 (bits 0:3 refer to EXTI4)
|
| ... | ... | @@ -99,7 +99,7 @@ void __attribute__((naked)) EXTI4_IRQHandler() |
|
|
|
// This is the function executed. It has to be declared as "used".
|
|
|
|
void __attribute__((used)) EXTI4_IRQHandlerImpl()
|
|
|
|
{
|
|
|
|
EXTI->PR |= EXTI_PR_PR4; // Always reset pending register!!!
|
|
|
|
EXTI->PR = EXTI_PR_PR4; // Always reset pending register!!!
|
|
|
|
// Write me!
|
|
|
|
}
|
|
|
|
```
|
| ... | ... | |