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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/26/07 22:24
Read: times


 
#145015 - it's good sometimes to violate the rules
Responding to: ???'s previous message
Matthias Arndt said:
Esp. the "keep it short and only set a flag" rule should recieve double attention. I have seen people doing everything in the interrupts and stoping all work because they couldn't debug it anymore...


The "rules" in the FAQ are not dogma. In programming, business and love, everything is allowed.

I do have a relatively big '51 application, where everything happens in two nested interrupts. The point here is, that what is processed in the interrupts, has to be processed within a tight time budget anyway (e.g. respond to a query via a network, which is idle (read, wasting precious communication time) until the mcu won't respond), so there is no reason to abandon the interrupt, and abort hastily what was been currently processed in main, in order to get the interrupt-produced data processed fast enough...

But, of course, this is not the typical picture. Exemptions can be found from each and every line in that FAQ; but by the time one knows how to handle those exceptions one needs no FAQs... So, the FAQ is aimed at the newbies and those are better off following the "rules".

Btw., the fact that some programs are harder to debug is IMHO not related to interrupts. It's more about style etc.


Matthias Arndt said:
PS: As I use the same technique in my own diploma thesis, is there am official term for those flags? They are not exactly semaphores but somehow a "schedule flag" which schedules a task to be run asap in the main loop.

Dunno. Signals, perhaps?

JW


List of 17 messages in thread
TopicAuthorDate
New FAQ III.            01/01/70 00:00      
   Similarly for 'C'            01/01/70 00:00      
   floating point            01/01/70 00:00      
      "fixed point" FAQ by Erik Malund            01/01/70 00:00      
   corrected FAQ            01/01/70 00:00      
   on 3V3 and 5V            01/01/70 00:00      
   when a RC "debouncing" circuit goes wrong            01/01/70 00:00      
   basic interrupt hints            01/01/70 00:00      
      the C hater            01/01/70 00:00      
         better?            01/01/70 00:00      
            very condensed but clear            01/01/70 00:00      
               it's good sometimes to violate the rules            01/01/70 00:00      
                  Rule breaking            01/01/70 00:00      
                     The idea of keeping the ISR routine short...            01/01/70 00:00      
                        epanded            01/01/70 00:00      
                        Exactly            01/01/70 00:00      
               flags            01/01/70 00:00      

Back to Subject List