Ejemplo n.º 1
0
void Isr_Init(void)
{
	int i = 0;
	intregs = S3C24X0_GetBase_INTERRUPT();

	for (i = 0; i < sizeof(isr_handle_array) / sizeof(isr_handle_array[0]); i++ )
	{
		isr_handle_array[i] = Dummy_isr;
	}

	intregs->INTMOD=0x0;				// All=IRQ mode
	intregs->INTMSK=BIT_ALLMSK;			// All interrupt is masked.

	//pISR_URXD0=(unsigned)Uart0_RxInt;
	//rINTMSK=~(BIT_URXD0);				//enable UART0 RX Default value=0xffffffff

	isr_handle_array[ISR_TIMER4_OFT] = IsrTimer4;
	isr_handle_array[ISR_WDT_OFT]  = IsrWatchdog;

#ifdef CONFIG_USB_DEVICE
	isr_handle_array[ISR_USBD_OFT] = IsrUsbd;
	isr_handle_array[ISR_DMA2_OFT] = IsrDma2;
	ClearPending(BIT_DMA2);
	ClearPending(BIT_USBD);
#endif
}
Ejemplo n.º 2
0
static void  Key_ISR1(void)
{
	U8 key;
	U32 r;

	if(rINTPND==BIT_EINT8_23) {
		ClearPending(BIT_EINT8_23);
		if(rEINTPEND&(1<<11)) {
		//Uart_Printf("eint11\n");
			rEINTPEND |= 1<< 11;
		}
		if(rEINTPEND&(1<<19)) {
		//	Uart_Printf("eint19\n");		
			rEINTPEND |= 1<< 19;
		}
	}
	if(rINTPND==BIT_EINT0) {
		//Uart_Printf("eint0\n");
		ClearPending(BIT_EINT0);
	}
	if(rINTPND==BIT_EINT2) {
		//Uart_Printf("eint2\n");
		ClearPending(BIT_EINT2);
	}
	key=Key_Scan1();
	if( key == 0xff )
		Uart_Printf( "Interrupt occur... Key is released!\n") ;
	else
		Uart_Printf( "Interrupt occur... K%d is pressed!\n", key) ;

}
Ejemplo n.º 3
0
void __irq AdcTsAuto(void)
{
	int i;
	U32 saveAdcdly;

    if(rADCDAT0&0x8000)
    {
		//Uart_Printf("\nStylus Up!!\n");
		rADCTSC&=0xff;	// Set stylus down interrupt bit
    }
    //else 
		//Uart_Printf("\nStylus Down!!\n");

	rADCTSC=(1<<3)|(1<<2);         //Pull-up disable, Seq. X,Y postion measure.
	saveAdcdly=rADCDLY;
	rADCDLY=40000;                 //Normal conversion mode delay about (1/50M)*40000=0.8ms

	rADCCON|=0x1;                   //start ADC

		while(rADCCON & 0x1);		//check if Enable_start is low
		while(!(rADCCON & 0x8000));        //check if EC(End of Conversion) flag is high, This line is necessary~!!
		
            while(!(rSRCPND & (BIT_ADC)));  //check if ADC is finished with interrupt bit

            xdata=(rADCDAT0&0x3ff);
            ydata=(rADCDAT1&0x3ff);

	 //YH 0627, To check Stylus Up Interrupt.
	 rSUBSRCPND|=BIT_SUB_TC;
	 ClearPending(BIT_ADC);
	 rINTSUBMSK=~(BIT_SUB_TC);
	 rINTMSK=~(BIT_ADC);
			 
	 rADCTSC =0xd3;    //Waiting for interrupt
	 rADCTSC=rADCTSC|(1<<8); // Detect stylus up interrupt signal.

			while(1)		//to check Pen-up state
			{
			 if(rSUBSRCPND & (BIT_SUB_TC))	//check if ADC is finished with interrupt bit
				 {
					//Uart_Printf("Stylus Up Interrupt~!\n");
					break;	//if Stylus is up(1) state
				}
			}	

    Uart_Printf("count=%03d  XP=%04d, YP=%04d\n", count++, xdata, ydata);    //X-position Conversion data            

	rADCDLY=saveAdcdly; 
	rADCTSC=rADCTSC&~(1<<8); // Detect stylus Down interrupt signal.
    rSUBSRCPND|=BIT_SUB_TC;
    rINTSUBMSK=~(BIT_SUB_TC);	// Unmask sub interrupt (TC)     
    ClearPending(BIT_ADC);
}
Ejemplo n.º 4
0
void __irq Uart0_TxDmaDone(void)
{
    rDMASKTRIG0=0x0;	// Stop Dma0
    isDone=0;
    rINTMSK |= BIT_DMA0;
    ClearPending(BIT_DMA0);
}
Ejemplo n.º 5
0
/***** WDT Interrupt Service Rotine *****/
void __irq Wdt_Int(void)
{
	rSUBSRCPND=(BIT_SUB_WDT);		// Clear Sub int pending
	ClearPending(BIT_WDT_AC97);		// Clear master pending

	 Uart_Printf("%d ",++isWdtInt);
}
Ejemplo n.º 6
0
static void __irq
Eint0Isr( void )
{
    Delay( 1000 );
    UartPrintf( "EINT0 is occurred.\n" );
    ClearPending( BIT_EINT0 );
}
Ejemplo n.º 7
0
void GraphicsWindow::ClearSuper(void) {
    HideGraphicsEditControl();
    ClearPending();
    ClearSelection();
    hover.Clear();
    EnsureValidActives();
}
Ejemplo n.º 8
0
static void __irq Uart0RxInt(void)
{
    ClearSubPending(BIT_SUB_RXD0); //rSUBSRCPND = BIT_SUB_RXD0;          //Clear pending bit (Requested)
    ClearPending(BIT_UART0);

    *temp ++= RdURXH0();
}
Ejemplo n.º 9
0
void __irq Rd_Int(void)
{
    ULONG i,status;

    status=rSDIFSTA;
    if( (status&0x200) == 0x200 )	// Check Last interrupt?
    {
	for(i=(status & 0x7f)/4;i>0;i--)
	{
	    *Rx_buffer++=rSDIDAT;
	    rd_cnt++;
	}
	rSDIFSTA=rSDIFSTA&0x200;	//Clear Rx FIFO Last data Ready, YH 040221
    }
    else if( (status&0x80) == 0x80 )	// Check Half interrupt?
    {
        for(i=0;i<8;i++)
        {
    	    *Rx_buffer++=rSDIDAT;
	    rd_cnt++;
	}
    }

    ClearPending(BIT_SDI);
}
Ejemplo n.º 10
0
static void __irq
Eint4Isr( void )
{
    Delay( 1000 );
    UartPrintf( "EINT4 is occurred.\n" );
    ClearPending( BIT_EINT4_7 );
    ClearExtPending( BIT_EXT_EINT4 );
}
Ejemplo n.º 11
0
void RxIRQStart(void)
{
    EnableIrq(BIT_UART2);
    EnableSubIrq(BIT_SUB_RXD2);
    ClearPending(BIT_UART2);
    rSUBSRCPND=BIT_SUB_RXD2;
    pISR_UART2=(U32)RxAndTxIRQ;
}
Ejemplo n.º 12
0
void Timer_InitEx(void)
{
	intCount=0;
	intregs->SUBSRCPND= (1<<13);
	ClearPending(BIT_WDT_AC97);				/*BIT_WDT*/
	intregs->INTMSK&=~(BIT_WDT_AC97);			/*BIT_WDT*/
	intregs->INTSUBMSK &= ~(1<<13);
}
Ejemplo n.º 13
0
void __irq Uart0_RxDmaDone(void)
{
    rDMASKTRIG0=0x0;	//DMA0 Channel Off
    isDone=0;
    *(uart0RxStr+5)='\0';
    rINTMSK|=(BIT_DMA0);
    ClearPending(BIT_DMA0);
}
Ejemplo n.º 14
0
void __irq Uart0_RxFifoOrErr(void)
{
    rINTSUBMSK|=(BIT_SUB_RXD0|BIT_SUB_TXD0|BIT_SUB_ERR0);
    if(rSUBSRCPND&BIT_SUB_RXD0) __sub_Uart0_RxFifo();
    else __sub_Uart0_RxErrInt();
    ClearPending(BIT_UART0);
    rSUBSRCPND=(BIT_SUB_RXD0|BIT_SUB_ERR0);	// Clear Sub int pending    
    rINTSUBMSK&=~(BIT_SUB_RXD0|BIT_SUB_ERR0);    
}
Ejemplo n.º 15
0
//---------------------------------------UART0 test function-------------------------------------
void __irq Uart0_TxInt(void)
{
    rINTSUBMSK|=(BIT_SUB_RXD0|BIT_SUB_TXD0|BIT_SUB_ERR0);	// Just for the safety
    if(*uart0TxStr != '\0') 
    {
        WrUTXH0(*uart0TxStr++);
	    ClearPending(BIT_UART0);		// Clear master pending
	    rSUBSRCPND=(BIT_SUB_TXD0);		// Clear Sub int pending
	    rINTSUBMSK&=~(BIT_SUB_TXD0);	// Unmask sub int
    }
    else
    {
    	isTxInt=0;
    	ClearPending(BIT_UART0);		// Clear master pending
        rSUBSRCPND=(BIT_SUB_TXD0);		// Clear Sub int pending
        rINTMSK|=(BIT_UART0);
    }
}
Ejemplo n.º 16
0
void EXTI::HandleInterrupt()
{
    ClearPending();
    if (_irqHandler)
    {
        _irqHandler->HandleInterrupt(this);
    }

}
Ejemplo n.º 17
0
void __irq Uart0_RxDmaOrErr(void)
{
    rINTSUBMSK|=(BIT_SUB_RXD0|BIT_SUB_TXD0|BIT_SUB_ERR0);
    if(rSUBSRCPND&BIT_SUB_ERR0) Uart_Printf("Error : UART0 Rx Interrupt is occured!!!\n");
    else __sub_Uart0_RxErrInt();
    
    ClearPending(BIT_UART0);
    rSUBSRCPND=(BIT_SUB_ERR0);	// Clear Sub int pending    
    rINTSUBMSK&=~(BIT_SUB_ERR0);    
}
Ejemplo n.º 18
0
void __irq Uart0_AfcRxOrErr(void)
{
    rINTSUBMSK|=(BIT_SUB_RXD0|BIT_SUB_TXD0|BIT_SUB_ERR0);
    if(rSUBSRCPND&BIT_SUB_RXD0) __sub_Uart0_RxAfc();    
    else __sub_Uart0_RxErrInt();

    ClearPending(BIT_UART0);
    rSUBSRCPND=(BIT_SUB_RXD0|BIT_SUB_TXD0|BIT_SUB_ERR0);
    rINTSUBMSK&=~(BIT_SUB_RXD0|BIT_SUB_TXD0|BIT_SUB_ERR0);
}
Ejemplo n.º 19
0
/*------------------------------------------------------------/
函数名称:	Eint3_ISR
功能描述:	外部中断3函数
传    参:	无
返 回 值:	无
-------------------------------------------------------------*/
void __irq Eint3_ISR(void) 
{ 
	disable_irq();

	ClearPending(BIT_EINT3);	//清除外部中断3的中断源请求
	uart0_sendstring("EINT3  is occurred.\n"); 
	rGPBDAT = ~(1<<8);			//LED2亮

	enable_irq();
} 
Ejemplo n.º 20
0
 /*------------------------------------------------------------/
函数名称:	Eint0_ISR
功能描述:	外部中断0函数
传    参:	无
返 回 值:	无
-------------------------------------------------------------*/
void __irq Eint0_ISR(void) 
{ 
    disable_irq();

	ClearPending(BIT_EINT0);	//清除外部中断0的中断源请求
	uart0_sendstring("EINT0  is occurred.\n"); 
	rGPBDAT = ~(1<<5);			//LED0亮

	enable_irq();
} 
Ejemplo n.º 21
0
/*------------------------------------------------------------/
函数名称:	Eint2_ISR
功能描述:	外部中断2函数
传    参:	无
返 回 值:	无
-------------------------------------------------------------*/
void __irq Eint2_ISR(void) 
{ 
	disable_irq();

    ClearPending(BIT_EINT2);	//清除外部中断2的中断源请求 
    uart0_sendstring("EINT2 is occurred.\n"); 
	rGPBDAT = ~(1<<6);			//LED1亮

	enable_irq();
} 
Ejemplo n.º 22
0
//--------------------------------------------------------------------
static void __irq T1Int(void)           //IRQ
{
    ClearPending(BIT_TIMER1);           //Timer1 Clear Interrupt
    fiqCnt1 += 1;
    
    if(fiqCnt0!=fiqCnt1)
        fiqCnt1 = 0; 
    if(fiqCnt0==10000)                  //Because FIQ interrupt has higher priority,
        rTCON   = 0x0;                  //fiqCnt0 will always be same with fiqCnt1.
}
Ejemplo n.º 23
0
void __irq Uart0_TxFifo(void)
{
    rINTSUBMSK|=(BIT_SUB_RXD0|BIT_SUB_TXD0|BIT_SUB_ERR0);	// Just for the safety
    while (!(rUFSTAT0 & 0x200) && (*uart0TxStr != '\0')) 	//until tx fifo full or end of string
    	WrUTXH0(*uart0TxStr++);	
   
    if(*uart0TxStr == '\0') 
    {
    	rINTMSK|=BIT_UART0;
    	rSUBSRCPND=BIT_SUB_TXD0;	// Clear Sub int pending
        ClearPending(BIT_UART0);	// Clear master pending
    }
    else 
    {
        ClearPending(BIT_UART0);	// Clear master pending
    	rSUBSRCPND=BIT_SUB_TXD0;	// Clear Sub int pending
        rINTSUBMSK&=~(BIT_SUB_TXD0);	// Unmask sub int
    }
}
Ejemplo n.º 24
0
/*------------------------------------------------------------/
函数名称:	Eint4_ISR
功能描述:	外部中断4函数
传    参:	无
返 回 值:	无
-------------------------------------------------------------*/
void __irq Eint4_ISR(void) 
{   
	disable_irq();
	 	
 	rEINTPEND = (1<<4);	        //清除外部中断标志(EINT4~EINT23需要)	

    ClearPending(BIT_EINT4_7);	//清除外部中断4的中断源请求 
    uart0_sendstring("EINT4 is occurred.\n"); 
	rGPBDAT = ~(1<<10);			//LED3亮

	enable_irq();
} 
Ejemplo n.º 25
0
void __irq Adc_or_TsSep(void)
{
    int i;
    U32 Pt[6];
    
    rINTSUBMSK |= (BIT_SUB_ADC|BIT_SUB_TC); // Mask sub interrupt (ADC and TC) 

      // TC(Touch screen Control) Interrupt 
    if(rADCTSC & 0x100)
    {
        Uart_Printf("\nStylus Up!!\n");
        rADCTSC &= 0xff;    // Set stylus down interrupt
    }
    else 
    {
        Uart_Printf("\nStylus Down!!\n");
           
          // <X-Position Read>
        rADCTSC=(0<<8)|(0<<7)|(1<<6)|(1<<5)|(0<<4)|(1<<3)|(0<<2)|(1);
          // Down,Hi-Z,AIN5,GND,Ext vlt,Pullup Dis,Normal,X-position
        for(i=0;i<LOOP;i++);            //delay to set up the next channel
        for(i=0;i<5;i++)
        {
            rADCCON|=0x1;               // Start X-position conversion
            while(rADCCON & 0x1);       // Check if Enable_start is low
            while(!(0x8000&rADCCON));   // Check ECFLG
            Pt[i]=(0x3ff&rADCDAT0);
        }
        Pt[5]=(Pt[0]+Pt[1]+Pt[2]+Pt[3]+Pt[4])/5;
        Uart_Printf("X-Posion[AIN5] is %04d\n", Pt[5]);

          // <Y-Position Read>
        rADCTSC=(0<<8)|(0<<7)|(1<<6)|(1<<5)|(0<<4)|(1<<3)|(0<<2)|(2);
          // Down,GND,Ext vlt,Hi-Z,AIN7,Pullup Dis,Normal,Y-position
        for(i=0;i<LOOP;i++);            //delay to set up the next channel
        for(i=0;i<5;i++)
        {
            rADCCON|=0x1;               // Start X-position conversion
            while(rADCCON & 0x1);       // Check if Enable_start is low
            while(!(0x8000&rADCCON));   // Check ECFLG
            Pt[i]=(0x3ff&rADCDAT1);
        }
        Pt[5]=(Pt[0]+Pt[1]+Pt[2]+Pt[3]+Pt[4])/5;
        Uart_Printf("Y-Posion[AIN7] is %04d\n", Pt[5]);
        rADCTSC=(1<<8)|(1<<7)|(1<<6)|(0<<5)|(1<<4)|(0<<3)|(0<<2)|(3);
          // Up,GND,AIN,Hi-z,AIN,Pullup En,Normal,Waiting mode
    }

    rSUBSRCPND |= BIT_SUB_TC;
    rINTSUBMSK =~ (BIT_SUB_TC);         // Unmask sub interrupt (TC)     
    ClearPending(BIT_ADC);
}
Ejemplo n.º 26
0
void GraphicsWindow::MouseLeftUp(double mx, double my) {
    orig.mouseDown = false;
    hoverWasSelectedOnMousedown = false;

    switch(pending.operation) {
        case DRAGGING_POINTS:
            SS.extraLine.draw = false;
            // fall through
        case DRAGGING_CONSTRAINT:
        case DRAGGING_NORMAL:
        case DRAGGING_RADIUS:
            ClearPending();
            InvalidateGraphics();
            break;

        case DRAGGING_MARQUEE:
            SelectByMarquee();
            ClearPending();
            InvalidateGraphics();
            break;

        case 0:
            // We need to clear the selection here, and not in the mouse down
            // event, since a mouse down without anything hovered could also
            // be the start of marquee selection. But don't do that on the
            // left click to cancel a context menu. The time delay is an ugly
            // hack.
            if(hover.IsEmpty() &&
                (contextMenuCancelTime == 0 ||
                 (GetMilliseconds() - contextMenuCancelTime) > 200))
            {
                ClearSelection();
            }
            break;

        default:
            break;  // do nothing
    }
}
Ejemplo n.º 27
0
static void __irq Key_ISR(void)
{
	U8 key;
	U32 r;

	EnterCritical(&r);
	if(rINTPND==BIT_EINT1)
	{
		//Uart_Printf("eint1\n");
		ClearPending(BIT_EINT1);
	}
	if(rINTPND==BIT_EINT4_7)
	{
		ClearPending(BIT_EINT4_7);
		if(rEINTPEND&(1<<4))
		{
			//Uart_Printf("eint4\n");
			rEINTPEND |= 1<< 4;
		}
	}
	if(rINTPND==BIT_EINT0)
	{
		//Uart_Printf("eint0\n");
		ClearPending(BIT_EINT0);
	}
	if(rINTPND==BIT_EINT2)
	{
		//Uart_Printf("eint2\n");
		ClearPending(BIT_EINT2);
	}

	key=Key_Scan();
	if( key == 0xff )
		Uart_Printf( "Interrupt occur... Key is released!\n") ;
	else
		Uart_Printf( "Interrupt occur... K%d is pressed!\n", key) ;

	ExitCritical(&r);
}
Ejemplo n.º 28
0
void __irq Uart0_AfcTx(void)
{
    rINTSUBMSK|=(BIT_SUB_RXD0|BIT_SUB_TXD0|BIT_SUB_ERR0);

    if(tx_cnt<AFC_BUFLEN)
    {
    	Uart_Printf("%d,",*txdataPt);
    	WrUTXH0(*txdataPt++);
	tx_cnt++;
        ClearPending(BIT_UART0);
        rSUBSRCPND=(BIT_SUB_TXD0);
        rINTSUBMSK&=~(BIT_SUB_TXD0);
    }
    else
    {
   	tx_end=1;
        while(rUFSTAT0 & 0x2f0);	//Until FIFO is empty
        ClearPending(BIT_UART0);
        rSUBSRCPND=(BIT_SUB_TXD0);
    	rINTMSK|=BIT_UART0;
    }
}
Ejemplo n.º 29
0
void RxAndTxIRQ(void)
{
    #if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr;
    #endif 
    if(rSUBSRCPND&BIT_SUB_RXD2)
    {
        OSSemPost(Rx_Sem);     
    }
    OS_ENTER_CRITICAL(); 
    rSUBSRCPND|=BIT_SUB_RXD2;   
    ClearPending(BIT_UART2);
    OS_EXIT_CRITICAL();
}
Ejemplo n.º 30
0
void __irq Wt_Int(void)
{
    ClearPending(BIT_SDI);

    rSDIDAT=*Tx_buffer++;
    wt_cnt++;

    if(wt_cnt==128*block)
    {
	rINTMSK |= BIT_SDI;
	rSDIDAT=*Tx_buffer;
	TR_end=1;
    }
}