Advertisement
Hoksmur

Untitled

Jun 30th, 2015
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.03 KB | None | 0 0
  1. void TIM3_IRQHandler(void)
  2. {
  3.   /* TIM3_CH1 toggling with frequency = 256.35 Hz */
  4.   if (TIM_GetITStatus(TIM3, TIM_IT_CC1) != RESET)
  5.   {
  6.     TIM_ClearITPendingBit(TIM3, TIM_IT_CC1 );
  7.     uhCapture = TIM_GetCapture1(TIM3);
  8.     TIM_SetCompare1(TIM3, uhCapture + uhCCR1_Val );
  9.   }
  10.  
  11.   /* TIM3_CH2 toggling with frequency = 512.7 Hz */
  12.   if (TIM_GetITStatus(TIM3, TIM_IT_CC2) != RESET)
  13.   {
  14.     TIM_ClearITPendingBit(TIM3, TIM_IT_CC2);
  15.     uhCapture = TIM_GetCapture2(TIM3);
  16.     TIM_SetCompare2(TIM3, uhCapture + uhCCR2_Val);
  17.   }
  18.  
  19.   /* TIM3_CH3 toggling with frequency = 1025.4 Hz */
  20.   if (TIM_GetITStatus(TIM3, TIM_IT_CC3) != RESET)
  21.   {
  22.     TIM_ClearITPendingBit(TIM3, TIM_IT_CC3);
  23.     uhCapture = TIM_GetCapture3(TIM3);
  24.     TIM_SetCompare3(TIM3, uhCapture + uhCCR3_Val);
  25.   }
  26.  
  27.   /* TIM3_CH4 toggling with frequency = 2050.78 Hz */
  28.   if (TIM_GetITStatus(TIM3, TIM_IT_CC4) != RESET)
  29.   {
  30.     TIM_ClearITPendingBit(TIM3, TIM_IT_CC4);
  31.     uhCapture = TIM_GetCapture4(TIM3);
  32.     TIM_SetCompare4(TIM3, uhCapture + uhCCR4_Val);
  33.   }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement