/******************************************************************************* * Function Name: PWM_Sleep ******************************************************************************** * * Summary: * Stops the component operation and saves the user configuration. * * Parameters: * None * * Return: * None * *******************************************************************************/ void PWM_Sleep(void) { if(0u != (PWM_BLOCK_CONTROL_REG & PWM_MASK)) { PWM_backup.enableState = 1u; } else { PWM_backup.enableState = 0u; } PWM_Stop(); PWM_SaveConfig(); }
/******************************************************************************* * Function Name: PWM_Sleep ******************************************************************************** * * Summary: * Disables block's operation and saves the user configuration. Should be called * just prior to entering sleep. * * Parameters: * void * * Return: * void * * Global variables: * PWM_backup.PWMEnableState: Is modified depending on the enable * state of the block before entering sleep mode. * *******************************************************************************/ void PWM_Sleep(void) { #if(PWM_UseControl) if(PWM_CTRL_ENABLE == (PWM_CONTROL & PWM_CTRL_ENABLE)) { /*Component is enabled */ PWM_backup.PWMEnableState = 1u; } else { /* Component is disabled */ PWM_backup.PWMEnableState = 0u; } #endif /* (PWM_UseControl) */ /* Stop component */ PWM_Stop(); /* Save registers configuration */ PWM_SaveConfig(); }