Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void TimerCaptureCompare_Ch2_Callback()
- {
- /* Get the Input Capture value */
- uwIC2Value = LL_TIM_IC_GetCaptureCH2(TIM3);
- if (uwIC2Value != 0)
- {
- /* Duty cycle computation */
- uwDutyCycle = (LL_TIM_IC_GetCaptureCH1(TIM3) * 100) / uwIC2Value;
- /* uwFrequency computation
- TIM3 freq = SystemCoreClock */
- uwFrequency = SystemCoreClock / (1*uwIC2Value);
- }
- else
- {
- uwDutyCycle = 0;
- uwFrequency = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement