测试StarterWare例程中dmTimer定时中断和uartEcho收发中断,单独运行都没有问题
试着把uartEcho中的UART相关内容移植到dmTimer工程中,这时问题来了
移植成功,编译下载运行后,UART收发正常,但是定时器中断没有了
接着做了多次测试,当屏蔽UART中断设置后,dmTimer定时中断回来了
问题好像在于1个中断源没有问题,2个中断源只响应了1个
main()
{
...
/* This function will enable clocks for the DMTimer2 instance */
DMTimer2ModuleClkConfig();
/* Enable IRQ in CPSR */
IntMasterIRQEnable();
/* Register DMTimer2 interrupts on to AINTC */
DMTimerAintcConfigure();
/* Perform the necessary configurations for DMTimer */
DMTimerSetUp();
/* Enable the DMTimer interrupts */
DMTimerIntEnable(DMTIMER_INSTANCE, DMTIMER_INT_OVF_EN_FLAG);
/* Configuring the system clocks for UART0 instance. */
UART0ModuleClkConfig();
/* Performing the Pin Multiplexing for UART0 instance. */
UARTPinMuxSetup(0);
/* Performing a module reset. */
UARTModuleReset(UART_INSTANCE_BASE_ADD);
/* Performing FIFO configurations. */
UartFIFOConfigure();
UartConfigure(BAUD_RATE_115200, (UART_FRAME_WORD_LENGTH_8 |
UART_FRAME_NUM_STB_1 |
UART_PARITY_NONE));
/* Configuring AINTC to receive UART0 interrupts. */
UARTINTCConfigure();
/* Enabling required UART Interrupts. */
UARTIntEnable(UART_INSTANCE_BASE_ADD,
(UART_INT_LINE_STAT | UART_INT_THR | UART_INT_RHR_CTI));
/* Start the DMTimer */
DMTimerEnable(DMTIMER_INSTANCE);
while(1){;}
}
static void DMTimerAintcConfigure(void)
{
/* Initialize the ARM interrupt control */
IntAINTCInit();
/* Registering DMTimerIsr */
IntRegister(SYS_INT_TINT2, DMTimerIsr);
/* Set the priority */
//IntPrioritySet(SYS_INT_TINT2, 0, AINTC_HOSTINT_ROUTE_IRQ);
IntPrioritySet(SYS_INT_TINT2, 2, AINTC_HOSTINT_ROUTE_FIQ); //两种设置均不成功
/* Enable the system interrupt */
IntSystemEnable(SYS_INT_TINT2);
}
static void UARTINTCConfigure(void)
{
/* Initializing the ARM Interrupt Controller. */
//IntAINTCInit(); //定时中断配置中已经进行了初始化, 此处不再初始化
/* Registering the Interrupt Service Routine(ISR). */
IntRegister(UART_INSTANCE_INT_NUM, UARTIsr);
//#define UART_INSTANCE_INT_NUM (SYS_INT_UART0INT)
//#define SYS_INT_UART0INT (72)
/* Setting the priority for the system interrupt in AINTC. */
IntPrioritySet(UART_INSTANCE_INT_NUM, 0, AINTC_HOSTINT_ROUTE_IRQ);
/* Enabling the system interrupt in AINTC. */
IntSystemEnable(UART_INSTANCE_INT_NUM);
}
请教是不是因两个中断源的问题,如何处理?