|
- //*****************added by haiou for magcard driver in 2010-04-20*****************************
- if(VirtualIRQ == IRQ_EINT10) //Track3
- {
- //OALMSG(TRUE, (L"*********OEMInterruptHandler:IRQ_EINT8 haiou************\r\n"));
- /*
- g_pMAGBuf->primal_num_track3 = 0;
- for(g_pMAGBuf->primal_num_track3; g_pMAGBuf->primal_num_track3primal_num_track3++)
- {
- g_pMAGBuf->card_data_track3[g_pMAGBuf->primal_num_track3] = g_pMAGBuf->primal_num_track3;
- }
- g_pMAGBuf->primal_num_track3 = 0;
- g_pGPIOReg->EINT0MASK &= ~(0x1<<8); // Enable EINT8
- g_pVIC0Reg->VICINTENABLE |= (0x1<
- */
- //OALMSG(TRUE, (L"*********OEMInterruptHandler:IRQ_EINT8 haiou************\r\n"));
- if(0x02 == (UCHAR)(g_pMAGBuf->trans_flag & BRUSH_END)) //只有IST允许,中断处理才能有效
- {
- if((!(g_pGPIOReg->GPKDAT & CP_LOW)) && (g_pMAGBuf->primal_num_track3 < 1000))
- {
- g_pMAGBuf->card_data_track3[g_pMAGBuf->primal_num_track3++] = (char)(g_pGPIOReg->GPKDAT & TRACK3); //读出GPK2 bit
- }
- g_pMAGBuf->trans_flag |= BRUSH_BEGIN;
- g_pGPIOReg->EINT0MASK &= ~(0x1<<10); // Enable EINT8
- g_pVIC0Reg->VICINTENABLE |= (0x1<
- }
- return SYSINTR_NOP;
- }
- if(VirtualIRQ == IRQ_EINT18) //Track2
- {
- //OALMSG(TRUE, (L"*********OEMInterruptHandler:IRQ_EINT9 haiou************\r\n"));
- if(0x02 == (UCHAR)(g_pMAGBuf->trans_flag & BRUSH_END)) //只有IST允许,中断处理才能有效
- {
- if((!(g_pGPIOReg->GPKDAT & CP_LOW)) && (g_pMAGBuf->primal_num_track2 < 300))
- {
- g_pMAGBuf->card_data_track2[g_pMAGBuf->primal_num_track2++] = (char)(g_pGPIOReg->GPKDAT & TRACK2); //读出GPK3 bit
- }
- g_pMAGBuf->trans_flag |= BRUSH_BEGIN;
- g_pGPIOReg->EINT0MASK &= ~(0x1<<18); // Enable EINT9
- g_pVIC1Reg->VICINTENABLE |= (0x1<<(PHYIRQ_EINT2-32)); //(IRQ_EINT4~IRQ_EINT11)
- }
- return SYSINTR_NOP;
- }
- //*******************end of magcard driver***************************************************/
复制代码引用 6 楼 paul85 的回复:
这个和isr里面判断中断源有关.举个例子.
if(int10)
{}
else if(int11)
{}
这种代码,如果两个中断同时来了,INT11就丢了.
会不会有这种现象发生.要不同时来中断,应该都会有响应.
if(int10)
{}
if(int11)
{}
这样判断就不会丢.
|
|