RobotCode/Generated_Source/PSoC4/Timer_Echo.c
uint32 Timer_Echo_ReadCompare(void)
{
    #if (Timer_Echo_CY_TCPWM_4000)
        uint32 currentMode;
        uint32 regVal;
    #endif /* (Timer_Echo_CY_TCPWM_4000) */

    #if (Timer_Echo_CY_TCPWM_4000)
        currentMode = ((Timer_Echo_CONTROL_REG & Timer_Echo_UPDOWN_MASK) >> Timer_Echo_UPDOWN_SHIFT);
        
        regVal = Timer_Echo_COMP_CAP_REG;
        
        if (((uint32)Timer_Echo__COUNT_DOWN == currentMode) && (0u != regVal))
        {
            regVal--;
        }
        else if (((uint32)Timer_Echo__COUNT_UP == currentMode) && (0xFFFFu != regVal))
        {
            regVal++;
        }
        else
        {
        }

        return (regVal & Timer_Echo_16BIT_MASK);
    #else
        return (Timer_Echo_COMP_CAP_REG & Timer_Echo_16BIT_MASK);
    #endif /* (Timer_Echo_CY_TCPWM_4000) */
}
/*******************************************************************************
* Function Name: Timer_Echo_ReadCompare
********************************************************************************
*
* Summary:
*  Reads the compare register. Not applicable for Timer/Counter with Capture
*  or in Quadrature Decoder modes.
*  PSoC 4000 devices read the incremented compare register value in the 
*  Up counting mode (except 0xFFFFu), and the decremented value in the 
*  Down counting mode (except 0x0u).
*
* Parameters:
*  None
*
* Return:
*  Compare value
*
* Note:
*  PSoC 4000 devices read the incremented compare register value in the 
*  Up counting mode (except 0xFFFFu), and the decremented value in the 
*  Down counting mode (except 0x0u).
*
*******************************************************************************/
Function Name: Timer_Echo_ReadCompare
Summary:
Reads the compare register. Not applicable for Timer/Counter with Capture
or in Quadrature Decoder modes.
PSoC 4000 devices read the incremented compare register value in the
Up counting mode (except 0xFFFFu), and the decremented value in the
Down counting mode (except 0x0u).

None

Compare value

PSoC 4000 devices read the incremented compare register value in the
Up counting mode (except 0xFFFFu), and the decremented value in the
Down counting mode (except 0x0u).
Function Name : Timer_Echo_ReadCompare Summary : Reads the compare register . Not applicable for Timer / Counter with Capture or in Quadrature Decoder modes . PSoC 4000 devices read the incremented compare register value in the Up counting mode ( except 0xFFFFu ) and the decremented value in the Down counting mode ( except 0x0u ) . None Compare value PSoC 4000 devices read the incremented compare register value in the Up counting mode ( except 0xFFFFu ) and the decremented value in the Down counting mode ( except 0x0u ) .
uint32 Timer_Echo_ReadCompare(void)
{
    #if (Timer_Echo_CY_TCPWM_4000)
        uint32 currentMode;
        uint32 regVal;
    #endif 
    #if (Timer_Echo_CY_TCPWM_4000)
        currentMode = ((Timer_Echo_CONTROL_REG & Timer_Echo_UPDOWN_MASK) >> Timer_Echo_UPDOWN_SHIFT);
        regVal = Timer_Echo_COMP_CAP_REG;
        if (((uint32)Timer_Echo__COUNT_DOWN == currentMode) && (0u != regVal))
        {
            regVal--;
        }
        else if (((uint32)Timer_Echo__COUNT_UP == currentMode) && (0xFFFFu != regVal))
        {
            regVal++;
        }
        else
        {
        }
        return (regVal & Timer_Echo_16BIT_MASK);
    #else
        return (Timer_Echo_COMP_CAP_REG & Timer_Echo_16BIT_MASK);
    #endif 
}
uint32 Timer_Echo_ReadCompare ( void ) { #if ( Timer_Echo_CY_TCPWM_4000 ) uint32 currentMode ; uint32 regVal ; #endif #if ( Timer_Echo_CY_TCPWM_4000 ) currentMode = ( ( Timer_Echo_CONTROL_REG & Timer_Echo_UPDOWN_MASK ) >> Timer_Echo_UPDOWN_SHIFT ) ; regVal = Timer_Echo_COMP_CAP_REG ; if ( ( ( uint32 ) Timer_Echo__COUNT_DOWN == currentMode ) && ( 0u != regVal ) ) { regVal -- ; } else if ( ( ( uint32 ) Timer_Echo__COUNT_UP == currentMode ) && ( 0xFFFFu != regVal ) ) { regVal ++ ; } else { } return ( regVal & Timer_Echo_16BIT_MASK ) ; #else return ( Timer_Echo_COMP_CAP_REG & Timer_Echo_16BIT_MASK ) ; #endif }
Function Name: Timer_Echo_ReadCompare
Summary:
Reads the compare register.
Function Name : Timer_Echo_ReadCompare Summary : Reads the compare register .
/* (Timer_Echo_CY_TCPWM_4000) */ /* (Timer_Echo_CY_TCPWM_4000) */