コード例 #1
0
ファイル: Comp_1.c プロジェクト: YLGH/BGSProject
/*******************************************************************************
* Function Name: Comp_1_Start
********************************************************************************
*
* Summary:
*  Performs all of the required initialization for the component and enables 
*  power to the block. The first time the routine is executed, the speed/power 
*  level, and hysteresis are set. When called to restart the comparator 
*  following a Stop() call, the current component parameter settings are retained.
*
* Parameters:
*  None
*
* Return:
*  None
*
* Global variables:
*  Comp_1_initVar: Is modified when this function is called for the
*   first time. Is used to ensure that initialization happens only once.
*
*******************************************************************************/
void Comp_1_Start(void)
{
    if( 0u == Comp_1_initVar)
    {
        Comp_1_Init();
        Comp_1_initVar = 1u;
    }
    Comp_1_Enable();
}
コード例 #2
0
ファイル: Comp_1_PM.c プロジェクト: ponioj/embedded
/*******************************************************************************
* Function Name: Comp_1_Wakeup
********************************************************************************
*
* Summary:
*  Restores and enables the user configuration
*  
* Parameters:
*  void
*
* Return:
*  void
*
* Global variables:
*  Comp_1_backup.enableState:  Is used to restore the enable state of 
*  block on wakeup from sleep mode.
*
*******************************************************************************/
void Comp_1_Wakeup(void) 
{
    Comp_1_RestoreConfig();
    
    if(Comp_1_backup.enableState == 1u)
    {
        /* Enable Comp's operation */
        Comp_1_Enable();

    } /* Do nothing if Comp was disabled before */ 
}