/******************************************************************************* * Function Name: PWM_1_Sleep ******************************************************************************** * * Summary: * Stops the component operation and saves the user configuration. * * Parameters: * None * * Return: * None * *******************************************************************************/ void PWM_1_Sleep(void) { if(0u != (PWM_1_BLOCK_CONTROL_REG & PWM_1_MASK)) { PWM_1_backup.enableState = 1u; } else { PWM_1_backup.enableState = 0u; } PWM_1_Stop(); PWM_1_SaveConfig(); }
/******************************************************************************* * Function Name: PWM_1_Sleep ******************************************************************************** * * Summary: * Disables block's operation and saves the user configuration. Should be called * just prior to entering sleep. * * Parameters: * None * * Return: * None * * Global variables: * PWM_1_backup.PWMEnableState: Is modified depending on the enable * state of the block before entering sleep mode. * *******************************************************************************/ void PWM_1_Sleep(void) { #if(PWM_1_UseControl) if(PWM_1_CTRL_ENABLE == (PWM_1_CONTROL & PWM_1_CTRL_ENABLE)) { /*Component is enabled */ PWM_1_backup.PWMEnableState = 1u; } else { /* Component is disabled */ PWM_1_backup.PWMEnableState = 0u; } #endif /* (PWM_1_UseControl) */ /* Stop component */ PWM_1_Stop(); /* Save registers configuration */ PWM_1_SaveConfig(); }