|
本帖最后由 jjj 于 2013-6-20 10:47 编辑
/**
* CS8900A interrupt handler, pulls incoming data from chip into FIFO
*/
void __irq
irq_handler(void)
{
// OS_CPU_SR cpu_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();
}
中断可以进,也可以出,但是堆栈错误,一会就死机,大家看看是不是缺什么呀 |
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|