Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/30/07 20:37
Read: times


 
Msg Score: +1
 +1 Informative
#138337 - agreed, I do it like this
Responding to: ???'s previous message
<It is not a bad idea to make empty Interupt subroutines.
This gets you a RETI if you acidently call one.
Better: It calls an error subroutine, or sets some error flag.

when I start a new project, the first file I include is my "device specific interrupt mosule"

it looks like this
//////////////////////////////////////////////////////////////////////
//
//  FILE:     F12xISR.C
//
//  COPYRIGHT: Copyright Twin Vision n.a. 2004
//
//  ISR template for the f12x




#include "WDdefs.h"


////////////////////////////////////////////////////////////
//
//  FUNCTION: void Icrash (void)
//
//  catcher for illegal interrupts
//

void Icrash (void)
{
while (1): // breakpoint here
}  // end Icrash


////////////////////////////////////////////////////////////
//
//  ISR 0  External interrupt 0
//

void EI0isr0 (void) interrupt 0 using 0
{
  Icrash();
}  // end EI0isr0


////////////////////////////////////////////////////////////
//
//  ISR 1  Timer 0 interrupt
//

void T0isr1  (void) interrupt 1 using 0
{
  Icrash();
} // end T0isr1


////////////////////////////////////////////////////////////
//
//  ISR 2  External interrupt 1
//

void EI1isr0 (void) interrupt 2 using 0
{
  Icrash();
}  // end EI1isr0


////////////////////////////////////////////////////////////
//
//  ISR 3  Timer 1 interrupt
//

void T1isr3 (void) interrupt 3 using 0
{
  Icrash();
} // timers_isr1


////////////////////////////////////////////////////////////
//
//  ISR 4 UART 0 
//

void U0isr4 (void) interrupt 4 using 0
{
  Icrash();
}  // end U0isr4




////////////////////////////////////////////////////////////
//
//  ISR 5 T2 
//

void T2isr5 (void) interrupt 5 using 0
{
  Icrash();
}  // end T2isr5




////////////////////////////////////////////////////////////
//
//  ISR 6 SPI 
//

void SPIisr6 (void) interrupt 6 using 0
{
  Icrash();
}  // end SPIisr6

etc  ... etc ...
It serves two purposes
1) all interrupts are 'caught'
2) all interrupt vectors are correctly named (I never screw up on an interrupy number)

All ISR work is done as a modification of these 'routines'

Erik






List of 43 messages in thread
TopicAuthorDate
Very stubborn UARTs...            01/01/70 00:00      
   Keil gives error on your construct            01/01/70 00:00      
      Re: error            01/01/70 00:00      
         a guess            01/01/70 00:00      
            Re: guess            01/01/70 00:00      
               humm humm            01/01/70 00:00      
                  re: humming            01/01/70 00:00      
   PS            01/01/70 00:00      
      have you tried the simulator?            01/01/70 00:00      
         Re: LED            01/01/70 00:00      
            HUH???            01/01/70 00:00      
               again a HLL habit, isn't it...            01/01/70 00:00      
            2 possibilities            01/01/70 00:00      
               Whoops.            01/01/70 00:00      
               Dummy Interupt            01/01/70 00:00      
                  agreed, I do it like this            01/01/70 00:00      
                     Niiice            01/01/70 00:00      
   you could solve a lot of problems if....            01/01/70 00:00      
      Thanks, but...            01/01/70 00:00      
   Back to square one?            01/01/70 00:00      
      blinkenlight            01/01/70 00:00      
         Get a \'scope!            01/01/70 00:00      
         More hints            01/01/70 00:00      
         Re: hints            01/01/70 00:00      
            I am sure it is published            01/01/70 00:00      
   Gah.            01/01/70 00:00      
      read the right spec            01/01/70 00:00      
         specs            01/01/70 00:00      
            Not a spec            01/01/70 00:00      
               why not?            01/01/70 00:00      
                  Proviso            01/01/70 00:00      
                     just a small remark            01/01/70 00:00      
            oh, yes, you can            01/01/70 00:00      
   Huzzah!            01/01/70 00:00      
      value of KISS            01/01/70 00:00      
      I find that hard to beleive!            01/01/70 00:00      
         Okay, so            01/01/70 00:00      
            I thotoughly agree with you there!            01/01/70 00:00      
            Further details            01/01/70 00:00      
      You\'re not finished yet            01/01/70 00:00      
         Lessons            01/01/70 00:00      
            \"does have it all\" is of no good            01/01/70 00:00      
            Thanks for the update            01/01/70 00:00      

Back to Subject List