用ZLG提供的ucos模板移植ucos到lpc2220+2Mflash的目标板上,在做串口中断实验时,发送可以通过中断发送,但接收不能进入中断服务程序; void uart0_isr(void) { uint8 ch = 0; uint32 i = 0; uint32 tmp = 0; uint32 bak = 0; struct UartStruct *ptr = &U0; //OSIntEnter();
OS_ENTER_CRITICAL(); onled4();//接收数据时,灯不亮,未进入isr,发送正常 /*中断处理*/ VICVectAddr = 0x00; OS_EXIT_CRITICAL(); }
void VICInit(void) { extern void IRQ_Handler(void); extern void Timer0_Handler(void); extern void Uart0_Handler(void);
VICProtection = 0; VICIntEnClr = 0xffffffff; VICDefVectAddr = (uint32)IRQ_Handler; VICVectAddr0 = (uint32)Timer0_Handler; VICVectCntl0 = (0x20 | 0x04);
VICVectAddr1 = (uint32)Uart0_Handler;//Interrupt source 6 VICVectCntl1 = (0x20 | VICIntSel_UART0);
//VICIntEnable = 1 << 4; VICIntEnable |= ( (1 << 4) | (1 << 6)); }
/*串口通信任务*/ void task_uart(void *pdata) { //uint8 buf[10] = {0,1,2,3,4,5,6,7,8,9};
pdata = pdata;
init_uart(UART0,BD9600); Rcv485_UART0(); Rcv485_UART1(); print("system start!
");
while (1) { OSTimeDly(10); rcvdatafrom485(UART0); LED2Glint(); //print("system start!
");
}
} 通过计算机向目标板发送数据帧时,根本不能进入中断服务函数,不知道哪里出了问题,初次接触ucos,还请指教
|