[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] [RFC] empty interrupts
From: |
E. Weddington |
Subject: |
Re: [avr-libc-dev] [RFC] empty interrupts |
Date: |
Thu, 08 May 2003 10:24:13 -0600 |
On 8 May 2003 at 9:59, Joerg Wunsch wrote:
> > Any objections to adding this to avr/signal.h?
>
> None from me, provided it gets a paragraph of doxygenation as well.
Attached is proposed patch. Comments?
Eric
Index: signal.h
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/include/avr/signal.h,v
retrieving revision 1.4
diff -u -r1.4 signal.h
--- signal.h 12 Dec 2002 11:41:01 -0000 1.4
+++ signal.h 8 May 2003 16:24:21 -0000
@@ -70,6 +70,30 @@
void signame (void)
#endif
+/** \def EMPTY_INTERRUPT(signame)
+ \ingroup avr_interrupts
+
+ \code#include <avr/signal.h>\endcode
+
+ Defines an empty interrupt handler function. This will not generate
+ any prolog or epilog code and will only return from the ISR. Do not
+ define a function body as this will define it for you.
+ Example:
+ \codeEMPTY_INTERRUPT(SIG_ADC);\endcode */
+
+#ifdef __cplusplus
+#define EMPTY_INTERRUPT(signame) \
+extern "C" void signame(void); \
+void signame (void) __attribute__ ((naked)); \
+void signame (void) { __asm__ __volatile__ ("reti" ::); }
+#else
+#define EMPTY_INTERRUPT(signame) \
+void signame (void) __attribute__ ((naked)); \
+void signame (void) { __asm__ __volatile__ ("reti" ::); }
+#endif
+
+
+
/address@hidden/
#endif /* _AVR_SIGNAL_H_ */