看看这个ucos中断有什么错误??
本帖最后由 jjj 于 2013-6-20 10:47 编辑/**
* CS8900A interrupt handler, pulls incoming data from chip into FIFO
*/
void __irq
irq_handler(void)
{
// OS_CPU_SRcpu_sr;
// cpu_sr=OS_CPU_SR_Save(); /* Tell the OS that we are starting an ISR */
// OSIntEnter();
// OS_CPU_SR_Restore(cpu_sr);
OSIntEnter();
// if(OSIntNesting==1)
// {OSTCBCur->OSTCBStrPtr=SP;}
//OS_ENTER_CRITICAL();
while (ISQ != 0)
{
/* (ISQ & 0x3F) will always be 4 here (RX event) */
int16_t len;
/* Discard first word: status */
len = RXTXREG;
len = RXTXREG;
if ((head - tail) < (FIFO_WORDS - 1 - ((len + 1) / 2)))
{ /* Got space for packet in FIFO */
pull_data(len);
}
else
{
/* Drop packet */
PACKETPP = CS_PP_RXCFG;
PPDATA = (0x0003U | 0x0100U/*RxOKiE*/ | 0x0040U/*Skip_1*/);
}
}
UART0_SendStr("cs8900 int\r\n");
OSSemPost(semkey) ;
EXTINT |= 1 << 2; //willow add
VICVectAddr = 0;
//sys_sem_signal(semkey);
UART0_SendStr("cs8900 int finished \r\n");
//OS_ENTER_CRITICAL();
OSIntExit();
}
中断可以进,也可以出,但是堆栈错误,一会就死机,大家看看是不是缺什么呀 OSSemPost(semkey) ;
只要把这一行去掉就正常了 现在把整个工程上传,求高手解答,LPC2294,UCOSii,LWIP,CS8900,估计也有人干兴趣。
页:
[1]