Example #1
0
File: Eint.c Project: 12019/mtktest
/*************************************************************************
* FUNCTION
*   EINT_SW_Debounce_Init
*
* DESCRIPTION
*   Initialize debounce time
*
* CALLS
*
* PARAMETERS
*
* RETURNS
*  No return
*
* GLOBALS AFFECTE
*
*************************************************************************/
void EINT_SW_Debounce_Init(void)
{
   kal_uint8 index;

   for (index = 0; index < EINT_MAX_CHANNEL; index++)
   {
      GPTI_GetHandle(&eint_sw_debounce[index].eint_sw_debounce_handle);
      eint_sw_debounce[index].eint_intr_allow = KAL_FALSE;
      eint_sw_debounce[index].eint_no = index;
   }

   eint_sw_debounce_time_delay = custom_config_eint_sw_debounce_time_delay();
}
Example #2
0
/*************************************************************************
* FUNCTION
*   EINT_SW_Debounce_Modify
*
* DESCRIPTION
*   Setting debounce time
*
* CALLS
*
* PARAMETERS
*
* RETURNS
*  No return
*
* GLOBALS AFFECTE
*
*************************************************************************/
kal_int32 EINT_SW_Debounce_Modify(kal_uint8 eintno, kal_uint8 debounce_time)
{
   kal_uint32 savedMask;
   
   if ( EINT_CheckNotHWDebounce(eintno))
      return -1;

   if(NULL == eint_sw_debounce_time_delay)
   {
       eint_sw_debounce_time_delay = custom_config_eint_sw_debounce_time_delay();
   }
   
   savedMask = SaveAndSetIRQMask();      
   eint_sw_debounce_time_delay[eintno] = debounce_time;
   RestoreIRQMask(savedMask);
   
   return 1;
}
Example #3
0
/*************************************************************************
* FUNCTION
*   EINT_SW_Debounce_Init
*
* DESCRIPTION
*   Initialize debounce time
*
* CALLS
*
* PARAMETERS
*
* RETURNS
*  No return
*
* GLOBALS AFFECTE
*
*************************************************************************/
void EINT_SW_Debounce_Init(void)
{
   kal_uint8 index;

   for (index = 0; index < EINT_TOTAL_CHANNEL; index++)
   {
      eint_sw_debounce[index].eint_sw_debounce_handle = 0x7f;
      if( EINT_CheckHWDebounce(index) )
      {
         eint_sw_debounce[index].eint_intr_allow = KAL_FALSE;
         eint_sw_debounce[index].eint_no = index;
      }
   }

   #ifndef ATEST_DRV_ENABLE
	eint_sw_debounce_time_delay = custom_config_eint_sw_debounce_time_delay();
   #endif
}