/* Enables or disables the TIM peripheral Main Outputs.  */
void TIM_CtrlPWMOutputs(TIM_TypeDef *TIMx, FunctionalState NewState)
/* Enables or disables the TIM peripheral Main Outputs.  */
void TIM_CtrlPWMOutputs(TIM_TypeDef *TIMx, FunctionalState NewState)
{
    assert_param(IS_TIM_18_PERIPH(TIMx));
    assert_param(IS_FUNCTIONAL_STATE(NewState));
    if (NewState != DISABLE)
    {
        TIMx->BDTR |= BDTR_MOE_Set;
    }
    else
    {
        TIMx->BDTR &= BDTR_MOE_Reset;
    }  
}