~ubuntu-branches/ubuntu/maverick/avr-libc/maverick

« back to all changes in this revision

Viewing changes to include/avr/interrupt.h

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2007-08-09 11:28:01 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070809112801-ps7wognnynio9kz7
Tags: 1:1.4.6-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2002,2005 Marek Michalkiewicz
 
1
/* Copyright (c) 2002,2005,2007 Marek Michalkiewicz
2
2
   All rights reserved.
3
3
 
4
4
   Redistribution and use in source and binary forms, with or without
28
28
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
29
  POSSIBILITY OF SUCH DAMAGE. */
30
30
 
31
 
/* $Id: interrupt.h,v 1.16.2.4 2006/09/27 05:10:43 joerg_wunsch Exp $ */
 
31
/* $Id: interrupt.h,v 1.16.2.6 2007/05/06 00:26:41 arcanum Exp $ */
32
32
 
33
33
#ifndef _AVR_INTERRUPT_H_
34
34
#define _AVR_INTERRUPT_H_
35
35
 
36
36
#include <avr/io.h>
37
37
 
 
38
/** 
 
39
\file 
 
40
\@{ 
 
41
*/
 
42
 
 
43
 
38
44
/** \name Global manipulation of the interrupt flag
39
45
 
40
46
    The global interrupt flag is maintained in the I bit of the status
41
 
    register (SREG). */
42
 
 
43
 
/*@{*/
 
47
    register (SREG). 
 
48
*/
44
49
 
45
50
#if defined(__DOXYGEN__)
46
51
/** \def sei()
47
52
    \ingroup avr_interrupts
48
53
 
49
 
    \code#include <avr/interrupt.h>\endcode
 
54
    \code #include <avr/interrupt.h> \endcode
50
55
 
51
56
    Enables interrupts by setting the global interrupt mask. This function
52
57
    actually compiles into a single line of assembly, so there is no function
53
58
    call overhead. */
54
 
extern void sei(void);
 
59
#define sei()
55
60
#else  /* !DOXYGEN */
56
61
# define sei()  __asm__ __volatile__ ("sei" ::)
57
62
#endif /* DOXYGEN */
60
65
/** \def cli()
61
66
    \ingroup avr_interrupts
62
67
 
63
 
    \code#include <avr/interrupt.h>\endcode
 
68
    \code #include <avr/interrupt.h> \endcode
64
69
 
65
70
    Disables all interrupts by clearing the global interrupt mask. This function
66
71
    actually compiles into a single line of assembly, so there is no function
67
72
    call overhead. */
68
 
extern void cli(void);
 
73
#define cli()
69
74
#else  /* !DOXYGEN */
70
75
# define cli()  __asm__ __volatile__ ("cli" ::)
71
76
#endif /* DOXYGEN */
72
77
 
73
 
/*@}*/
74
78
 
75
79
/** \name Macros for writing interrupt handler functions */
76
80
 
77
 
/*@{*/
78
81
 
79
82
#if defined(__DOXYGEN__)
80
83
/** \def ISR(vector)
81
84
    \ingroup avr_interrupts
82
85
 
83
 
    \code#include <avr/interrupt.h>\endcode
 
86
    \code #include <avr/interrupt.h> \endcode
84
87
 
85
88
    Introduces an interrupt handler function (interrupt service
86
89
    routine) that runs with global interrupts initially disabled.
113
116
/** \def SIGNAL(vector)
114
117
    \ingroup avr_interrupts
115
118
 
116
 
    \code#include <avr/interrupt.h>\endcode
 
119
    \code #include <avr/interrupt.h> \endcode
117
120
 
118
121
    Introduces an interrupt handler function that runs with global interrupts
119
122
    initially disabled.
120
123
 
121
124
    This is the same as the ISR macro.
122
 
    \deprecated Do not use anymore in new code.
 
125
    \deprecated Do not use SIGNAL() in new code. Use ISR() instead.
123
126
*/
124
127
#  define SIGNAL(vector)
125
128
#else  /* real code */
140
143
/** \def EMPTY_INTERRUPT(vector)
141
144
    \ingroup avr_interrupts
142
145
 
143
 
    \code#include <avr/interrupt.h>\endcode
 
146
    \code #include <avr/interrupt.h> \endcode
144
147
 
145
148
    Defines an empty interrupt handler function. This will not generate
146
149
    any prolog or epilog code and will only return from the ISR. Do not
171
174
/** \def ISR_ALIAS(vector, target_vector)
172
175
    \ingroup avr_interrupts
173
176
 
174
 
    \code#include <avr/interrupt.h>\endcode
 
177
    \code #include <avr/interrupt.h> \endcode
175
178
 
176
179
    Defines \c vector to point to the same interrupt vector as
177
180
    \c target_vector.  That way, a single interrupt vector
190
193
    }
191
194
 
192
195
    ISR_ALIAS(INT1_vect, INT0_vect);
193
 
    \endcode */
 
196
    \endcode 
 
197
*/
194
198
#define ISR_ALIAS(vector, target_vector)
195
199
#else /* real code */
196
200
 
203
207
#endif /* DOXYGEN */
204
208
 
205
209
 
206
 
/*@}*/
207
 
 
208
 
#ifdef __cplusplus
209
 
extern "C" {
210
 
#endif
211
 
 
212
 
#ifdef __cplusplus
213
 
}
214
 
#endif
 
210
/* \@} */
215
211
 
216
212
#endif