Add this to the main loop or a setup function:
printf("Set pin callback failure!\r\n");
while (1) {
}
}
- Initialize a pin to trigger an interrupt. Here, we initialize PC03 as an input pin with pull up and glitch filter and to generate an interrupt on a falling edge.
- Set a callback for the pin interrupt.
printf("Set pin callback failure!\r\n");
while (1) {
}
}
- Enable pin interrupt.
Interrupt Usage
When an interrupt happens on a pin, it will execute your callback function.