请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:EK-TM4C123GXL 您好!
我尝试从两个不同的端口读取两个中断、但它不起作用。 如果我禁用一个端口的初始化、另一个端口将正常工作。 反之亦然。 我使用的是 TivaWare、我无法找出问题所在。
一个中断用于读取远程控制器值、另一个中断用于读取 MPU6050的"数据就绪引脚"。
我将在下面粘贴两个中断的代码。
感谢您的帮助!
SysCtlPeripheralEnable (SYSCTL_Periph_GPIOD); SysCtlDelay (3); GPIOPinTypeGPIOInput (GPIO_PORTD_base、GPIO_PIN_1); GPIOIntDisable (GPIO_PORTD_base、 GPIO_PIN_1); GPIOIntClear (GPIO_PORTD_base、GPIO_PIN_1); GPIOIntRegister (GPIO_PORTD_base、readMPU); GPIOIntTypeSet (GPIO_PORTD_base、GPIO_PIN_1、GPIO_RISING _EDGE); IntPrioritySet (INT_GPIOD、0); GPIOIntEnable (GPIO_PORTD_base、GPIO_INT_PIN_1);
SysCtlPeripheralEnable (SYSCTL_Periph_GPIOA);
SysCtlDelay (3); GPIOPinTypeGPIOInput (GPIO_Porta_base、GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7); GPIOIntDisable (GPIO_Porta_base、GPIO_PIN_2 | GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_4 | GPIO_PIN_7 | GPIO_PIN_4 | GPIO_PIN_6 | GPIO_PIN_4 | GPIO_PIN_4 | GPIO_PIN_4 | GPIO_PIN_4 | GPIO_PIN_4 | GPIO_PIN_4 | GPIO_PIN_4 | GPIO_PIN_4 | GPIO_PIN_4 | GPIO_PIN_4 | GPIO_PIN_PIN_4 | GPIO_PIN_GPIO_PIN_4 | GPIO_PIN_PIN_PIN_4 | GPIO_PIN_PIN_4 GPIOIntTypeSet (GPIO_PORta_base、GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7、GPIO_BLE_edges); IntPrioritySet (INT_GPIOA、0); GPIOIntEnable (GPIO_Porta_base、 GPIO_INT_PIN_2 | GPIO_INT_PIN_3 | GPIO_INT_PIN_4 | GPIO_INT_PIN_5 | GPIO_INT_PIN_6 | GPIO_INT_PIN_7);