Interrupts are asynchronous **hardware signals** that can be handled in software. They are handled by the microcontroller immediately, therefore **interrupting** whatever was being executed before the interrupt.
Interrupts can be generated by different events, such as exceptions, timer counter overflows, incoming messages on a bus, GPIO level change etc... All these events generate an Interrupt REQuest (IRQ), which is managed in software by the corresponding IRQHandler().
Interrupts can be generated by different events, such as exceptions, timer counter overflows, incoming messages on a bus, GPIO level change etc... All these events generate an **Interrupt REQuest (IRQ)**, which is managed in software by the corresponding IRQHandler().
This page gives some quick information on how to use Interrupts with MIOSIX in STM32 boards.
...
...
@@ -56,7 +56,7 @@ NVIC_EnableIRQ(EXTI4_IRQn);
NVIC_SetPriority(EXTI4_IRQn,15);
```
## Step 3: Writing a IRQHandler
## Step 3: Writing an IRQHandler
In the `core/stage_1_boot.cpp` file of your board (located in `miosix-kernel/miosix/arch/<ARCH>/<BOARD>/`) all the possible IRQHandlers are defined. They are all defined with `__attribute__((weak))`: this means that if you provide your own implementation of the same function in a .cpp file and compile it, the default one will be overridden by yours.