[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] RE: Class Interrupts
From: |
Ron Kreymborg |
Subject: |
RE: [avr-gcc-list] RE: Class Interrupts |
Date: |
Thu, 27 Mar 2008 14:52:24 +1100 |
Thanks to a few clues from Marek, this is now working well. The syntax is:
void MyInt(void) __attribute__ ((signal(xx), __INTR_ATTRS));
where xx is a number within the range of AVR interrupts and MyInt can be any
name.
Although not part of the patch, some thought should be given to the C user
macro. The simplest is a small change to the ISR macro:
#define ISR(name, ...) \
void name(void) __attribute__ ((signal(__VA_ARGS__), __INTR_ATTRS)); \
void name(void)
However without the interrupt number the name must be from the respective
ioxx.h file or the jump link fails, so there is a potential for confusion.
Might I suggest a new macro:
#define ISRN(name, number) \
void name(void) __attribute__ ((signal(number), __INTR_ATTRS)); \
void name(void)
For C++ users the method definition can sometimes be in the header and the
implementation elsewhere (in the cpp file), so the second line above is not
needed. Perhaps the macro:
#define CLASS_ISR(name, number) \
void name(void) __attribute__ ((signal(number), __INTR_ATTRS));
Ron
- [avr-gcc-list] error: sys/types.h, FRANCISCO ESPINOLA, 2008/03/20
- Re: [avr-gcc-list] error: sys/types.h, Joerg Wunsch, 2008/03/22
- Message not available
- Message not available
- [avr-gcc-list] RE: Class Interrupts, Ron Kreymborg, 2008/03/23
- Re: [avr-gcc-list] RE: Class Interrupts, Marek Michalkiewicz, 2008/03/23
- RE: [avr-gcc-list] RE: Class Interrupts, Ron Kreymborg, 2008/03/24
- RE: [avr-gcc-list] RE: Class Interrupts, Weddington, Eric, 2008/03/24
- RE: [avr-gcc-list] RE: Class Interrupts, Ron Kreymborg, 2008/03/24
- RE: [avr-gcc-list] RE: Class Interrupts,
Ron Kreymborg <=
- RE: [avr-gcc-list] RE: Class Interrupts, Ron Kreymborg, 2008/03/29