CCS/CapTouch_Tuning/Library/CTS_Layer.c
/***************************************************************************/
/**
 * @brief   Determine if a button is being pressed
 * @param   groupOfElements Pointer to button to be scanned
 * @return  result Indication if button is (1) or is not (0) being pressed
 ******************************************************************************/
@brief   Determine if a button is being pressed
@param   groupOfElements Pointer to button to be scanned
@return  result Indication if button is (1) or is not (0) being pressed
@brief Determine if a button is being pressed @param groupOfElements Pointer to button to be scanned @return result Indication if button is ( 1 ) or is not ( 0 ) being pressed
uint8_t TI_CAPT_Button(const struct Sensor * groupOfElements)
{
    uint8_t result = 0;
    #ifndef RAM_FOR_FLASH
    uint16_t *measCnt;
    measCnt = (uint16_t *)malloc(groupOfElements->numElements * sizeof(uint16_t));
    if(measCnt ==0)
    {
        while(1);
    }
    #endif
    TI_CAPT_Custom(groupOfElements, measCnt);
    #ifndef RAM_FOR_FLASH
    free(measCnt);
    #endif
    if(ctsStatusReg & EVNT)
    {
        result = 1;
    }    
    return result;
}
uint8_t TI_CAPT_Button ( const struct Sensor * groupOfElements ) { uint8_t result = 0 ; #ifndef RAM_FOR_FLASH uint16_t * measCnt ; measCnt = ( uint16_t * ) malloc ( groupOfElements -> numElements * sizeof ( uint16_t ) ) ; if ( measCnt == 0 ) { while ( 1 ) ; } #endif TI_CAPT_Custom ( groupOfElements , measCnt ) ; #ifndef RAM_FOR_FLASH free ( measCnt ) ; #endif if ( ctsStatusReg & EVNT ) { result = 1 ; } return result ; }
@brief   Determine if a button is being pressed
 @param   groupOfElements Pointer to button to be scanned
 @return  result Indication if button is (1) or is not (0) being pressed
@brief Determine if a button is being pressed @param groupOfElements Pointer to button to be scanned @return result Indication if button is ( 1 ) or is not ( 0 ) being pressed