Here is an example on how to write a user defined ISR.
The example enables the GPT0 Capture Compare A Interrupt
I've used a similar process for additional ADC interrupts, so I think what is written below is correct!
BR, Richard
Enable the interrupt in the ICU tab of the Synergy Configurator.
Generate & Build the project.
If you were to run the project, as part of SystemInit (), there is a function call to bsp_irq_cfg ();
voidSystemInit (void)
/* Initialize ELC events that will be used to trigger NVIC interrupts. */
bsp_irq_cfg();
This populates the Interrupt Enable Select Registers in the ICU.
This can be seen the IO Register ICU -> IELSR debug view
We now have to write the ISR.
In the source file, for example hal_entry.c, write the following:
To enable the interrupt, the interrupt has to be enable in the NVIC.
In source file, for example hal_entry.c, write the following:
In the ISR it will most likely to clear the interrupt flags that have been set in the IELSR and potentially, the peripheral.
In this example of the GPT, the code would be: