Skip to content

Commit f88c984

Browse files
committed
Removed deprecated interrupt handlers
Fixes #831 #881 #955 #1123 #1140
1 parent 0e7a434 commit f88c984

File tree

6 files changed

+32
-44
lines changed

6 files changed

+32
-44
lines changed

build/shared/revisions.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ ARDUINO 1.0.5
33

44
[core]
55

6-
* malloc bug: backported avr-libc 1.8.0 implementation
6+
* [avr] malloc bug: backported avr-libc 1.8.0 implementation
7+
* [avr] removed deprecated interrupt handlers causing compiler issues
8+
with newer avr-gcc.
79

810
[libraries]
911

hardware/arduino/cores/arduino/HardwareSerial.cpp

+6-20
Original file line numberDiff line numberDiff line change
@@ -104,24 +104,16 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
104104
#if !defined(USART0_RX_vect) && defined(USART1_RX_vect)
105105
// do nothing - on the 32u4 the first USART is USART1
106106
#else
107-
#if !defined(USART_RX_vect) && !defined(SIG_USART0_RECV) && \
108-
!defined(SIG_UART0_RECV) && !defined(USART0_RX_vect) && \
109-
!defined(SIG_UART_RECV)
107+
#if !defined(USART_RX_vect) && !defined(USART0_RX_vect)
110108
#error "Don't know what the Data Received vector is called for the first UART"
111109
#else
112110
void serialEvent() __attribute__((weak));
113111
void serialEvent() {}
114112
#define serialEvent_implemented
115113
#if defined(USART_RX_vect)
116-
SIGNAL(USART_RX_vect)
117-
#elif defined(SIG_USART0_RECV)
118-
SIGNAL(SIG_USART0_RECV)
119-
#elif defined(SIG_UART0_RECV)
120-
SIGNAL(SIG_UART0_RECV)
114+
ISR(USART_RX_vect)
121115
#elif defined(USART0_RX_vect)
122-
SIGNAL(USART0_RX_vect)
123-
#elif defined(SIG_UART_RECV)
124-
SIGNAL(SIG_UART_RECV)
116+
ISR(USART0_RX_vect)
125117
#endif
126118
{
127119
#if defined(UDR0)
@@ -149,7 +141,7 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
149141
void serialEvent1() __attribute__((weak));
150142
void serialEvent1() {}
151143
#define serialEvent1_implemented
152-
SIGNAL(USART1_RX_vect)
144+
ISR(USART1_RX_vect)
153145
{
154146
if (bit_is_clear(UCSR1A, UPE1)) {
155147
unsigned char c = UDR1;
@@ -158,15 +150,13 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
158150
unsigned char c = UDR1;
159151
};
160152
}
161-
#elif defined(SIG_USART1_RECV)
162-
#error SIG_USART1_RECV
163153
#endif
164154

165155
#if defined(USART2_RX_vect) && defined(UDR2)
166156
void serialEvent2() __attribute__((weak));
167157
void serialEvent2() {}
168158
#define serialEvent2_implemented
169-
SIGNAL(USART2_RX_vect)
159+
ISR(USART2_RX_vect)
170160
{
171161
if (bit_is_clear(UCSR2A, UPE2)) {
172162
unsigned char c = UDR2;
@@ -175,15 +165,13 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
175165
unsigned char c = UDR2;
176166
};
177167
}
178-
#elif defined(SIG_USART2_RECV)
179-
#error SIG_USART2_RECV
180168
#endif
181169

182170
#if defined(USART3_RX_vect) && defined(UDR3)
183171
void serialEvent3() __attribute__((weak));
184172
void serialEvent3() {}
185173
#define serialEvent3_implemented
186-
SIGNAL(USART3_RX_vect)
174+
ISR(USART3_RX_vect)
187175
{
188176
if (bit_is_clear(UCSR3A, UPE3)) {
189177
unsigned char c = UDR3;
@@ -192,8 +180,6 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
192180
unsigned char c = UDR3;
193181
};
194182
}
195-
#elif defined(SIG_USART3_RECV)
196-
#error SIG_USART3_RECV
197183
#endif
198184

199185
void serialEventRun(void)

hardware/arduino/cores/arduino/WInterrupts.c

+16-16
Original file line numberDiff line numberDiff line change
@@ -230,82 +230,82 @@ void attachInterruptTwi(void (*userFunc)(void) ) {
230230
*/
231231

232232
#if defined(__AVR_ATmega32U4__)
233-
SIGNAL(INT0_vect) {
233+
ISR(INT0_vect) {
234234
if(intFunc[EXTERNAL_INT_0])
235235
intFunc[EXTERNAL_INT_0]();
236236
}
237237

238-
SIGNAL(INT1_vect) {
238+
ISR(INT1_vect) {
239239
if(intFunc[EXTERNAL_INT_1])
240240
intFunc[EXTERNAL_INT_1]();
241241
}
242242

243-
SIGNAL(INT2_vect) {
243+
ISR(INT2_vect) {
244244
if(intFunc[EXTERNAL_INT_2])
245245
intFunc[EXTERNAL_INT_2]();
246246
}
247247

248-
SIGNAL(INT3_vect) {
248+
ISR(INT3_vect) {
249249
if(intFunc[EXTERNAL_INT_3])
250250
intFunc[EXTERNAL_INT_3]();
251251
}
252252

253253
#elif defined(EICRA) && defined(EICRB)
254254

255-
SIGNAL(INT0_vect) {
255+
ISR(INT0_vect) {
256256
if(intFunc[EXTERNAL_INT_2])
257257
intFunc[EXTERNAL_INT_2]();
258258
}
259259

260-
SIGNAL(INT1_vect) {
260+
ISR(INT1_vect) {
261261
if(intFunc[EXTERNAL_INT_3])
262262
intFunc[EXTERNAL_INT_3]();
263263
}
264264

265-
SIGNAL(INT2_vect) {
265+
ISR(INT2_vect) {
266266
if(intFunc[EXTERNAL_INT_4])
267267
intFunc[EXTERNAL_INT_4]();
268268
}
269269

270-
SIGNAL(INT3_vect) {
270+
ISR(INT3_vect) {
271271
if(intFunc[EXTERNAL_INT_5])
272272
intFunc[EXTERNAL_INT_5]();
273273
}
274274

275-
SIGNAL(INT4_vect) {
275+
ISR(INT4_vect) {
276276
if(intFunc[EXTERNAL_INT_0])
277277
intFunc[EXTERNAL_INT_0]();
278278
}
279279

280-
SIGNAL(INT5_vect) {
280+
ISR(INT5_vect) {
281281
if(intFunc[EXTERNAL_INT_1])
282282
intFunc[EXTERNAL_INT_1]();
283283
}
284284

285-
SIGNAL(INT6_vect) {
285+
ISR(INT6_vect) {
286286
if(intFunc[EXTERNAL_INT_6])
287287
intFunc[EXTERNAL_INT_6]();
288288
}
289289

290-
SIGNAL(INT7_vect) {
290+
ISR(INT7_vect) {
291291
if(intFunc[EXTERNAL_INT_7])
292292
intFunc[EXTERNAL_INT_7]();
293293
}
294294

295295
#else
296296

297-
SIGNAL(INT0_vect) {
297+
ISR(INT0_vect) {
298298
if(intFunc[EXTERNAL_INT_0])
299299
intFunc[EXTERNAL_INT_0]();
300300
}
301301

302-
SIGNAL(INT1_vect) {
302+
ISR(INT1_vect) {
303303
if(intFunc[EXTERNAL_INT_1])
304304
intFunc[EXTERNAL_INT_1]();
305305
}
306306

307307
#if defined(EICRA) && defined(ISC20)
308-
SIGNAL(INT2_vect) {
308+
ISR(INT2_vect) {
309309
if(intFunc[EXTERNAL_INT_2])
310310
intFunc[EXTERNAL_INT_2]();
311311
}
@@ -314,7 +314,7 @@ SIGNAL(INT2_vect) {
314314
#endif
315315

316316
/*
317-
SIGNAL(SIG_2WIRE_SERIAL) {
317+
ISR(TWI_vect) {
318318
if(twiIntFunc)
319319
twiIntFunc();
320320
}

hardware/arduino/cores/arduino/wiring.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ volatile unsigned long timer0_millis = 0;
4242
static unsigned char timer0_fract = 0;
4343

4444
#if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
45-
SIGNAL(TIM0_OVF_vect)
45+
ISR(TIM0_OVF_vect)
4646
#else
47-
SIGNAL(TIMER0_OVF_vect)
47+
ISR(TIMER0_OVF_vect)
4848
#endif
4949
{
5050
// copy these to local variables so they can be stored in registers

libraries/Servo/Servo.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -100,28 +100,28 @@ static inline void handle_interrupts(timer16_Sequence_t timer, volatile uint16_t
100100
#ifndef WIRING // Wiring pre-defines signal handlers so don't define any if compiling for the Wiring platform
101101
// Interrupt handlers for Arduino
102102
#if defined(_useTimer1)
103-
SIGNAL (TIMER1_COMPA_vect)
103+
ISR(TIMER1_COMPA_vect)
104104
{
105105
handle_interrupts(_timer1, &TCNT1, &OCR1A);
106106
}
107107
#endif
108108

109109
#if defined(_useTimer3)
110-
SIGNAL (TIMER3_COMPA_vect)
110+
ISR(TIMER3_COMPA_vect)
111111
{
112112
handle_interrupts(_timer3, &TCNT3, &OCR3A);
113113
}
114114
#endif
115115

116116
#if defined(_useTimer4)
117-
SIGNAL (TIMER4_COMPA_vect)
117+
ISR(TIMER4_COMPA_vect)
118118
{
119119
handle_interrupts(_timer4, &TCNT4, &OCR4A);
120120
}
121121
#endif
122122

123123
#if defined(_useTimer5)
124-
SIGNAL (TIMER5_COMPA_vect)
124+
ISR(TIMER5_COMPA_vect)
125125
{
126126
handle_interrupts(_timer5, &TCNT5, &OCR5A);
127127
}

libraries/Wire/utility/twi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void twi_releaseBus(void)
360360
twi_state = TWI_READY;
361361
}
362362

363-
SIGNAL(TWI_vect)
363+
ISR(TWI_vect)
364364
{
365365
switch(TW_STATUS){
366366
// All Master

0 commit comments

Comments
 (0)