/******************************************************************************* * Function Name: Timer_2_Sleep ******************************************************************************** * * Summary: * Stops the component operation and saves the user configuration. * * Parameters: * None * * Return: * None * *******************************************************************************/ void Timer_2_Sleep(void) { if(0u != (Timer_2_BLOCK_CONTROL_REG & Timer_2_MASK)) { Timer_2_backup.enableState = 1u; } else { Timer_2_backup.enableState = 0u; } Timer_2_Stop(); Timer_2_SaveConfig(); }
/******************************************************************************* * Function Name: Timer_2_Sleep ******************************************************************************** * * Summary: * Stop and Save the user configuration * * Parameters: * void * * Return: * void * * Global variables: * Timer_2_backup.TimerEnableState: Is modified depending on the * enable state of the block before entering sleep mode. * *******************************************************************************/ void Timer_2_Sleep(void) { #if(!Timer_2_ControlRegRemoved) /* Save Counter's enable state */ if(Timer_2_CTRL_ENABLE == (Timer_2_CONTROL & Timer_2_CTRL_ENABLE)) { /* Timer is enabled */ Timer_2_backup.TimerEnableState = 1u; } else { /* Timer is disabled */ Timer_2_backup.TimerEnableState = 0u; } #endif /* Back up enable state from the Timer control register */ Timer_2_Stop(); Timer_2_SaveConfig(); }