/* Return the output level (high or low) of the selected comparator.  */
uint32_t COMP_ReadOutPutLevel(COMP_SELECT_T compSelect)
/* Return the output level (high or low) of the selected comparator.  */
uint32_t COMP_ReadOutPutLevel(COMP_SELECT_T compSelect)
{
    uint32_t compOUT = 0x00;
    if (compSelect == COMP_SELECT_COMP1)
    {
        if ((COMP->CSTS & COMP_CSTS_COMP1OUT)  != 0)
        {
            compOUT = COMP_OUTPUTLEVEL_HIGH;
        }
        else
            compOUT = COMP_OUTPUTLEVEL_LOW;
    }
    else
    {
        if ((COMP->CSTS & COMP_CSTS_COMP2OUT)  != 0)
        {
            compOUT = COMP_OUTPUTLEVEL_HIGH;
        }
        else
            compOUT = COMP_OUTPUTLEVEL_LOW;
    }
    return (uint32_t)(compOUT);
}