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: Joerg Wunsch
Subject: Re: [avr-libc-dev] What about to make 'reti' as a default behaviour?
Date: Tue, 18 Dec 2007 16:19:21 +0100
User-agent: Mutt/1.5.11

As Weddington, Eric wrote:

> Regarding the discussion: First, is it an error to not have a
> handler for an enabled interrupt? I would think yes.

I agree.

> If the default is just to return, then I would agree that that does
> not really let the user know of the error. It can get too easily
> lost. The symptoms would just be reduced performance.

In other situations (missing USART interrupt handler), it would enter
an infinite loop only anyway.

There's once been a suggestion from Peter Dannegger in the
German-language www.mikrocontroller.net forum...  Ah, yes, his
suggestion was to *call* (rather than jump) to the default handler,
and then

POP r31
POP r30

there so the return address can be monitored by a debugger.  One of
the biggest questions with the current implementation is that you're
suddenly faced with: ``Hmm, my program seems to reset the controller,
probably a stray interrupt, but heck, *what* interrupt is it?''

> Would it be better to have the default call exit(1)? Does the default
> implementation of exit go into an infinite loop?

It does, but I'd prefer calling (or jumping to) abort() instead.  It's
also an infinite loop by default but it's the intended fault exit
point.

I think both, exit() and abort() should disable interrupts before
running into the loop.  Opinions on that?  If we agree, it would be a
feature that either has to go into 1.6.0 still, or it will be delayed
until 1.8.x because it's a non backwards-compatible change.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

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