#include "Examples.h"
#include "netx_drv.h"
void callbackGPIO0(void*pvContext,void*pvCustom){
// Callback callbackGPIO1 is called after or inside callbackGPIO0 depending on the priority group
DRV_NVIC_SetPendingIRQ(gpio_app1_IRQn);
__BKPT();
}
void callbackGPIO1(void*pvContext,void*pvCustom){
__BKPT();
}
int nvicexample(int argc, const char* argv[]) {
(void) DRV_DIO_ChannelIRQAttach(DRV_DIO_ID_GPIO_0,callbackGPIO0,0);
(void) DRV_DIO_ChannelIRQAttach(DRV_DIO_ID_GPIO_1,callbackGPIO1,0);
// Callback callbackGPIO1 is called after callbackGPIO0 because of same priority group
DRV_NVIC_SetPendingIRQ(gpio_app0_IRQn);
DRV_NVIC_SetPriority(gpio_app1_IRQn,1,0);
DRV_NVIC_SetPriority(gpio_app0_IRQn,2,0);
// Callback callbackGPIO1 is called inside callbackGPIO0 because of different priority group
DRV_NVIC_SetPendingIRQ(gpio_app0_IRQn);
return 0;
} |