Пример #1
0
/*******************************************************************************
* Function Name: Timer_Sleep
********************************************************************************
*
* Summary:
*  Stops the component operation and saves the user configuration.
*
* Parameters:
*  None
*
* Return:
*  None
*
*******************************************************************************/
void Timer_Sleep(void)
{
    if(0u != (Timer_BLOCK_CONTROL_REG & Timer_MASK))
    {
        Timer_backup.enableState = 1u;
    }
    else
    {
        Timer_backup.enableState = 0u;
    }

    Timer_Stop();
    Timer_SaveConfig();
}
Пример #2
0
/*******************************************************************************
* Function Name: Timer_Sleep
********************************************************************************
*
* Summary:
*     Stop and Save the user configuration
*
* Parameters:
*  void
*
* Return:
*  void
*
* Global variables:
*  Timer_backup.TimerEnableState:  Is modified depending on the
*  enable state of the block before entering sleep mode.
*
*******************************************************************************/
void Timer_Sleep(void) 
{
    #if(!Timer_UDB_CONTROL_REG_REMOVED)
        /* Save Counter's enable state */
        if(Timer_CTRL_ENABLE == (Timer_CONTROL & Timer_CTRL_ENABLE))
        {
            /* Timer is enabled */
            Timer_backup.TimerEnableState = 1u;
        }
        else
        {
            /* Timer is disabled */
            Timer_backup.TimerEnableState = 0u;
        }
    #endif /* Back up enable state from the Timer control register */
    Timer_Stop();
    Timer_SaveConfig();
}