LCD_TFT_Driver/CTS_Layer.c
/***************************************************************************/
/**
 * @brief   Determine which button if any is being pressed
 * @param   groupOfElements Pointer to buttons to be scanned
 * @return  result pointer to element (button) being pressed or 0 none
 ******************************************************************************/
@brief   Determine which button if any is being pressed
@param   groupOfElements Pointer to buttons to be scanned
@return  result pointer to element (button) being pressed or 0 none
@brief Determine which button if any is being pressed @param groupOfElements Pointer to buttons to be scanned @return result pointer to element ( button ) being pressed or 0 none
const struct Element *TI_CAPT_Buttons(const struct Sensor *groupOfElements)
{
    uint8_t index;
    #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);
    if(ctsStatusReg & EVNT)
    {
        index = Dominant_Element(groupOfElements, measCnt);
        index++;
    }
    else 
    {
        index = 0;
    }
    #ifndef RAM_FOR_FLASH
    free(measCnt);
    #endif
    if(index)
    {
      return groupOfElements->arrayPtr[index-1];
    }
    return 0;
}
const struct Element * TI_CAPT_Buttons ( const struct Sensor * groupOfElements ) { uint8_t index ; #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 ) ; if ( ctsStatusReg & EVNT ) { index = Dominant_Element ( groupOfElements , measCnt ) ; index ++ ; } else { index = 0 ; } #ifndef RAM_FOR_FLASH free ( measCnt ) ; #endif if ( index ) { return groupOfElements -> arrayPtr [ index - 1 ] ; } return 0 ; }
@brief   Determine which button if any is being pressed
 @param   groupOfElements Pointer to buttons to be scanned
 @return  result pointer to element (button) being pressed or 0 none
@brief Determine which button if any is being pressed @param groupOfElements Pointer to buttons to be scanned @return result pointer to element ( button ) being pressed or 0 none
//ctsStatusReg &= ~EVNT;
