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

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

Re: [avr-libc-dev] vector section disable, vector redirection


From: Michael Schulze
Subject: Re: [avr-libc-dev] vector section disable, vector redirection
Date: Thu, 23 Aug 2007 14:57:46 +0200
User-agent: Thunderbird 1.5.0.12 (X11/20070719)

Hi,

But if the ISR does not call a function,
then it looks like this vector redirection system would
still introduce a
code overhead, correct? If so, then doing this would be
unacceptable for
smaller devices with minimal code space.
yes, that's correct. as there were all vectors defined by
default, overhead is introduced for unused vectors.
Code size is usually the primary criteria. I would not recommend using a new
interrupt system at the cost of adding more code size. Though your methods
might be useful for some users who might need such a system.

well, maybe the whole redirection-talk misleads my intention. i do not want to discuss a new interrupt system. as code size is often the main criteria, a simple jump is of course the best solution. apart from diabling all vectors, the way the avr-libc performs that works very fine for me. my reason to describe the environment was to explain the reason to change another way and to present a solution. or, in short words: the "why" and a thinkable "how".

ok, i will give it another try: at least in my opinion, a library should offer 
as many support and possibilities as possible. and the way the vector names are 
processed at the moment prohibits a free use by any user.
currently, vector names are processed by the preprocessor in the following way 
(taken INT0 again as a representative):

in (most) io.h files
#define INT0_vect                       _VECTOR(1)
->
an ISR(INT0_vect) will be processed in interrupt.h to
void _VECTOR(1) (void)
->
further processed with the help of sfr_defs.h to __vector_1 to void __vector_1 (void)
->
symbol used in gcrt

for some unknown reasons, the effort is made to include the _VECTOR(x) macro in all relevant io-header-files. quite a lot. ok, library source size is assumed to be negligible :). future changes in the interrupt system could therefore require to re-process each io.h. additionally, and more important to me, it prohibits to use the vector name in a free (numeric) way. there are no disadvantages in moving the _VECTOR(x) to a central place:

#define INT0_vect                       1
-> interrupt.h
void _VECTOR(1) (void)

and the same procedure as now goes it's way. it's just a simple and in my 
opinion advantageous other sequence of the already in-use preprocessor 
procedure.
I think the change request of Jörg Diederich is comprehensible and it seems to have no side effects as I see. The proposed change allows more free use of the interrupt part of avr-libc and don't prohibit the old way it goes.

Currently, I am working on a flexible interrupt redirection mechanism for the avr-libc which integrates seamless and doesn't forbid the use of ISR. Therewith, the direct binding of interrupt service routines to the vector table is always possible. By the way, I would appreciate the change, because I need also the number of the interrupt source for my redirection scheme and I wouldn't define it again, because it is always error prone.

I don't know, how you see that, but I would suggest Jörg that he provide a patch. We could see whether it is ok for the lib and if it is, the change is put into the next version of avr-libc.

Michael

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

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