/* Wait for Capture Falling Indicator */
while(PWM_GetCaptureIntFlag(PWM, u32Ch) < 2);
/* Clear Capture Falling Indicator (Time B)*/
PWM_ClearCaptureIntFlag(PWM, u32Ch, PWM_CAPTURE_INT_FALLING_LATCH);
u32i = 0;
while(u32i < 4)
{
/* Wait for Capture Falling Indicator */
while(PWM_GetCaptureIntFlag(PWM, u32Ch) < 2);
/* Clear Capture Falling and Rising Indicator */
PWM_ClearCaptureIntFlag(PWM, u32Ch, PWM_CAPTURE_INT_FALLING_LATCH | PWM_CAPTURE_INT_RISING_LATCH);
/* Get Capture Falling Latch Counter Data */
u32Count[u32i++] = PWM_GET_CAPTURE_FALLING_DATA(PWM, u32Ch);
/* Wait for Capture Rising Indicator */
while(PWM_GetCaptureIntFlag(PWM, u32Ch) < 2);
/* Clear Capture Rising Indicator */
PWM_ClearCaptureIntFlag(PWM, u32Ch, PWM_CAPTURE_INT_RISING_LATCH);
/* Get Capture Rising Latch Counter Data */
u32Count[u32i++] = PWM_GET_CAPTURE_RISING_DATA(PWM, u32Ch);
}
|