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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/16/04 12:23
Read: times


 
#77486 - RE: Avoid USING !
Responding to: ???'s previous message
Because it can causes crashes, if subroutines called with a different register bank usage.
And some times it can occur, that hidden subroutines are called.


If subroutines are called both from main() and interrupts you will have a disaster on hand whether you use 'using' or not. Of course, there is the 'reentrant' keyword, but 'forgetting' that will lead to a category 10 bug.

I would much rather have the whole thing blow up immediately beacause of different banks that get the cat 10 bug from a missing 'reentrant'


Writing handlers for unused interrupts make absolutely no sense, because all these are disabled after every reset.
unless 'accidentially' enabled

So triggering of unused interrupts can only point out two things:
- the reset was done wrong
- the chip was damaged or buggy

you forgot the third: faulty software.

While your statement "it can not happen" is true in an ideal world, the addition of crash(); to the unused interrupts create a means of catching that pesky SW bug that otherwise takes days to find. Also, in this case, it was suggested as a debugging measure.

I put crash() in all unused ISRs every time and rarely do I find it useful BUT when it is useful it saves DAYS of debugging. When a mystery comes up, set a breakpoint in crash() and in no time I know whether the mystery is due to a false interrupt or not.

I have had the following C code result in a call to crash() because of an interrupt interaction and had I not had crash() in the unused ISRs I would have been lost for a long while;

saveIE = IE;
EA = FALSE;
...
....
IE = saveIE;

Better safe than sorry

Erik

List of 43 messages in thread
TopicAuthorDate
Priority interrupt problem with DS5240            01/01/70 00:00      
   RE: Priority interrupt problem with DS5240            01/01/70 00:00      
      RE: Priority interrupt problem with DS5240            01/01/70 00:00      
         RE: Priority interrupt problem with DS5240            01/01/70 00:00      
            RE: Priority interrupt problem with DS5240            01/01/70 00:00      
            RE: Priority interrupt problem with DS5240            01/01/70 00:00      
   just a thought            01/01/70 00:00      
      RE: just a thought            01/01/70 00:00      
         RE: just a thought            01/01/70 00:00      
            RE: just a thought            01/01/70 00:00      
               RE: just a thought            01/01/70 00:00      
                  RE: just a thought            01/01/70 00:00      
                     RE: just a thought            01/01/70 00:00      
                        RE: just a thought            01/01/70 00:00      
                           RE: just a thought            01/01/70 00:00      
                  RE: just a thought            01/01/70 00:00      
   Avoid USING !            01/01/70 00:00      
      RE: Avoid USING !            01/01/70 00:00      
         caught it myseld            01/01/70 00:00      
      RE: Avoid USING !            01/01/70 00:00      
   RE: Priority interrupt problem with DS5240            01/01/70 00:00      
   RE: Priority interrupt problem with DS5240            01/01/70 00:00      
      RE: Priority interrupt problem with DS52            01/01/70 00:00      
   RE: Priority interrupt problem with DS5240            01/01/70 00:00      
      Get rid of USING            01/01/70 00:00      
   RE: Priority interrupt problem with DS5240            01/01/70 00:00      
      use using ???            01/01/70 00:00      
   Resolved?            01/01/70 00:00      
   My USING experience            01/01/70 00:00      
      RE: My USING experience            01/01/70 00:00      
         Resolved ? ... I don\'t know            01/01/70 00:00      
   !! PROBLEM SOLVED!!!!            01/01/70 00:00      
      Which compiler?            01/01/70 00:00      
         RE: Which compiler?            01/01/70 00:00      
      RE: !! PROBLEM SOLVED!!!!            01/01/70 00:00      
         RE: !! PROBLEM SOLVED!!!!            01/01/70 00:00      
            RE: !! PROBLEM SOLVED!!!!            01/01/70 00:00      
      RE: !! PROBLEM SOLVED!!!!            01/01/70 00:00      
         RE: !! PROBLEM SOLVED!!!!            01/01/70 00:00      
            RE: !! PROBLEM SOLVED!!!!            01/01/70 00:00      
   RE: Priority interrupt problem with DS5240            01/01/70 00:00      
      RE: Priority interrupt problem with DS5240            01/01/70 00:00      
         RE: Priority interrupt problem with DS5240            01/01/70 00:00      

Back to Subject List