avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] What about to make 'reti' as a default behaviour?


From: Marek Michalkiewicz
Subject: Re: [avr-libc-dev] What about to make 'reti' as a default behaviour?
Date: Mon, 17 Dec 2007 00:45:27 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

On Sun, Dec 16, 2007 at 04:16:40PM -0700, Weddington, Eric wrote:

> > Now in case of unforeseen interrupt the program is
> > jumped to zero address. As a rule, such behaviour
> > is bad, as it leads to restart program without
> > restarting a MCU's hardware.
> > 
> > What about to perform 'reti' in case if the user
> > does not define own __vector_default ?
> 
> That seems like a safe alternative. This has my vote.

Not always safe - if interrupt is level triggered, and remains
active, the main program will be interrupted again and again...
This will make the main program run much slower (interrupt and
"reti" after every instruction), but work fine otherwise - so
it may be difficult to notice the bug (no handler defined for an
enabled interrupt).  An infinite loop might be even better than
either "reti" or jump to zero (WDT will then do a proper reset).
Critical applications still want to define own __vector_default
(to safely stop the machine, report the problem, etc.).

Marek




reply via email to

[Prev in Thread] Current Thread [Next in Thread]