cocus

C18 interruption remapping

May 15th, 2011
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.76 KB | None | 0 0
  1. /** V E C T O R  R E M A P P I N G *******************************************/
  2.  
  3.     #pragma code HIGH_INTERRUPT_VECTOR = 0x08
  4.     void Remapped_High_ISR (void)
  5.     {
  6.          _asm goto HighPriorityISRCode _endasm
  7.     }
  8.     #pragma code LOW_INTERRUPT_VECTOR = 0x18
  9.     void Remapped_Low_ISR (void)
  10.     {
  11.          _asm goto LowPriorityISRCode _endasm
  12.     }
  13.     #pragma code
  14.        
  15.     //These are your actual interrupt handling routines.
  16.     #pragma interrupt HighPriorityISRCode
  17.     void HighPriorityISRCode()
  18.     {
  19.         // check here for High Priority interrupts (PIR1bits, INTCON, etc)
  20.  
  21.     }
  22.  
  23.     #pragma interruptlow LowPriorityISRCode
  24.     void LowPriorityISRCode()
  25.     {  
  26.  
  27.     }
  28.  
  29. /** D E C L A R A T I O N S **************************************************/
  30. #pragma code
  31.  
  32. void main(void)
  33. {
  34.     // ....
  35. }
Advertisement
Add Comment
Please, Sign In to add comment