RobotCode/Generated_Source/PSoC4/Timer_Echo.c
uint32 Timer_Echo_ReadCompareBuf(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_BUF_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_BUF_REG & Timer_Echo_16BIT_MASK);
    #endif /* (Timer_Echo_CY_TCPWM_4000) */
}
/*******************************************************************************
* Function Name: Timer_Echo_ReadCompareBuf
********************************************************************************
*
* Summary:
*  Reads the compare buffer register. Not applicable for Timer/Counter with
*  Capture or in Quadrature Decoder modes.
*
* Parameters:
*  None
*
* Return:
*  Compare buffer 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_ReadCompareBuf
Summary:
Reads the compare buffer register. Not applicable for Timer/Counter with
Capture or in Quadrature Decoder modes.

None

Compare buffer 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_ReadCompareBuf Summary : Reads the compare buffer register . Not applicable for Timer / Counter with Capture or in Quadrature Decoder modes . None Compare buffer 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_ReadCompareBuf(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_BUF_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_BUF_REG & Timer_Echo_16BIT_MASK);
    #endif 
}
uint32 Timer_Echo_ReadCompareBuf ( 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_BUF_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_BUF_REG & Timer_Echo_16BIT_MASK ) ; #endif }
Function Name: Timer_Echo_ReadCompareBuf
Summary:
Reads the compare buffer register.
Function Name : Timer_Echo_ReadCompareBuf Summary : Reads the compare buffer register .
/* (Timer_Echo_CY_TCPWM_4000) */ /* (Timer_Echo_CY_TCPWM_4000) */