[Top][All Lists]

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

Re: [avr-libc-dev] Can main be interrupt or signal?

From: Paul Schlie
Subject: Re: [avr-libc-dev] Can main be interrupt or signal?
Date: Sun, 13 Feb 2005 18:30:10 -0500
User-agent: Microsoft-Entourage/

> From: Björn Haase <address@hidden>
>>> From: Andy Hutchinson <address@hidden>
>>> I'm just reviewing gcc prolog code.
>>> Is it "legal" to allow or want  "main" to be an "interrupt" or "signal"
>>> functiom.
> IMHO it is not useful to declare main to carry the attribute signal or
> interrupt. The way interrupts work presently is to declare functions that
> carry the name __vector01 or similar. If functions with this name are
> declared, they override the weak symbols of the .crt object files that point
> to a default IRQ function.
> Since main is supposed to be named "main" one would need to violate gcc in
> order to make shure that main could be called by calling vectorXX().
> IIUC you could safely assume that main does not carry the interrupt or signal
> attributes.

So how ideally could one define an arbitrary interrupt vector to invoke
main(), as doing a soft restart upon some particular event doesn't seem like
an unreasonable thing to want to do?

reply via email to

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