/* param base Ctimer peripheral base address param matchChannel Match pin to be used to output the PWM signal param dutyCyclePercent New PWM pulse width; the value should be between 0 to 100  */
void CTIMER_UpdatePwmDutycycle(CTIMER_Type *base, ctimer_match_t matchChannel, uint8_t dutyCyclePercent)
/* param base Ctimer peripheral base address param matchChannel Match pin to be used to output the PWM signal param dutyCyclePercent New PWM pulse width; the value should be between 0 to 100  */
void CTIMER_UpdatePwmDutycycle(CTIMER_Type *base, ctimer_match_t matchChannel, uint8_t dutyCyclePercent)
{
    uint32_t pulsePeriod = 0, period;
    period = base->MR[kCTIMER_Match_3];
    if (dutyCyclePercent == 0U)
    {
        pulsePeriod = period + 1U;
    }
    else
    {
        pulsePeriod = (period * (100U - (uint32_t)dutyCyclePercent)) / 100U;
    }
    base->MR[matchChannel] = pulsePeriod;
}