Exemplo n.º 1
0
/*-----------------------------------------------------------------------*
* FUNCTION                                                            
*	GPT_LISR
*
* DESCRIPTION                                                           
*   	GPT interrupt handler
*
* CALLS  
*	It is called when GPT interrupt is coming
*
* PARAMETERS
*	None
*	
* RETURNS
*	None
*
* GLOBALS AFFECTED
*   external_global
*------------------------------------------------------------------------*/
void GPT_LISR(void)
{
	kal_uint16 GPT_Status;
  	IRQMask(IRQ_GPT_CODE);
	GPT_Status = DRV_GPT_Reg(GPT_STS);
	
	if (GPT_Status & GPT_STS_1)
	{
		HGPT1_Callback();
	}
	if (GPT_Status & GPT_STS_2)
	{
		HGPT2_Callback();
	}
   IRQClearInt(IRQ_GPT_CODE);
   IRQUnmask(IRQ_GPT_CODE);
}
/*-----------------------------------------------------------------------*
* FUNCTION                                                            
*	GPT_LISR
*
* DESCRIPTION                                                           
*   	GPT interrupt handler
*
* CALLS  
*	It is called when GPT interrupt is coming
*
* PARAMETERS
*	None
*	
* RETURNS
*	None
*
* GLOBALS AFFECTED
*   external_global
*------------------------------------------------------------------------*/
extern void GPT_MS_Time_Out_Handler(kal_uint16 *ms_handle_sta);	/*defined in dcl_gpt.c*/
extern  kal_uint16 gpt_ms_lisr_handle_status;	/*defined in dcl_gpt.c*/
void GPT_LISR(void)
{
	kal_uint16 GPT_Status;
  	IRQMask(IRQ_GPT_CODE);
	GPT_Status = DRV_GPT_Reg(GPT_STS);
	
	if (GPT_Status & GPT_STS_1)
	{
		HGPT1_Callback();
	}
	if (GPT_Status & GPT_STS_2)
	{
		/*--------*/
		//add for 1ms GPT run in LISR context
		GPT_MS_Time_Out_Handler(&gpt_ms_lisr_handle_status);

		HGPT2_Callback(); /* always active hisr ,here may be some optimize */
	}
   IRQClearInt(IRQ_GPT_CODE);
   IRQUnmask(IRQ_GPT_CODE);
}