Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. int count;
  2.  
  3. /*
  4. ===========================================
  5. ============= ISR FOR WAVES ===============
  6. */
  7.  
  8.  
  9. void __ISR( _TIMER_2_VECTOR, ipl4) T2Interrupt( void)
  10. {
  11.  
  12.     if(triangle)
  13.         //do nothing
  14.     else if(square)
  15.         OC5RS = (count < 22) ? PR2 : 0;
  16.     else if(exp)
  17.         OC5RS =  pow(2,count);
  18.     else if(sin)
  19.         OC1RS = Table[ count++];
  20.  
  21.     count++;
  22.     if ( count >= 44)
  23.         count = 0;
  24.  
  25.     // clear interrupt flag and exit
  26.     mT2ClearIntFlag();
  27. } // T2 Interrupt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement