summaryrefslogtreecommitdiff
path: root/java/arduino/sig-patch.diff
blob: 4be3a6cdc4c4af7526aad4f6f0c3765bb100f60c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
diff -ruN arduino-1.0.1.orig/hardware/arduino/cores/arduino/HardwareSerial.cpp arduino-1.0.1/hardware/arduino/cores/arduino/HardwareSerial.cpp
--- arduino-1.0.1.orig/hardware/arduino/cores/arduino/HardwareSerial.cpp	2012-05-21 13:01:43.000000000 -0400
+++ arduino-1.0.1/hardware/arduino/cores/arduino/HardwareSerial.cpp	2012-10-19 23:26:46.000000000 -0400
@@ -88,24 +88,16 @@
 #if !defined(USART0_RX_vect) && defined(USART1_RX_vect)
 // do nothing - on the 32u4 the first USART is USART1
 #else
-#if !defined(USART_RX_vect) && !defined(SIG_USART0_RECV) && \
-    !defined(SIG_UART0_RECV) && !defined(USART0_RX_vect) && \
-	!defined(SIG_UART_RECV)
+#if !defined(USART_RX_vect) && !defined(USART0_RX_vect)
   #error "Don't know what the Data Received vector is called for the first UART"
 #else
   void serialEvent() __attribute__((weak));
   void serialEvent() {}
   #define serialEvent_implemented
 #if defined(USART_RX_vect)
-  SIGNAL(USART_RX_vect)
-#elif defined(SIG_USART0_RECV)
-  SIGNAL(SIG_USART0_RECV)
-#elif defined(SIG_UART0_RECV)
-  SIGNAL(SIG_UART0_RECV)
+  ISR(USART_RX_vect)
 #elif defined(USART0_RX_vect)
-  SIGNAL(USART0_RX_vect)
-#elif defined(SIG_UART_RECV)
-  SIGNAL(SIG_UART_RECV)
+  ISR(USART0_RX_vect)
 #endif
   {
   #if defined(UDR0)
@@ -124,39 +116,33 @@
   void serialEvent1() __attribute__((weak));
   void serialEvent1() {}
   #define serialEvent1_implemented
-  SIGNAL(USART1_RX_vect)
+  ISR(USART1_RX_vect)
   {
     unsigned char c = UDR1;
     store_char(c, &rx_buffer1);
   }
-#elif defined(SIG_USART1_RECV)
-  #error SIG_USART1_RECV
 #endif
 
 #if defined(USART2_RX_vect) && defined(UDR2)
   void serialEvent2() __attribute__((weak));
   void serialEvent2() {}
   #define serialEvent2_implemented
-  SIGNAL(USART2_RX_vect)
+  ISR(USART2_RX_vect)
   {
     unsigned char c = UDR2;
     store_char(c, &rx_buffer2);
   }
-#elif defined(SIG_USART2_RECV)
-  #error SIG_USART2_RECV
 #endif
 
 #if defined(USART3_RX_vect) && defined(UDR3)
   void serialEvent3() __attribute__((weak));
   void serialEvent3() {}
   #define serialEvent3_implemented
-  SIGNAL(USART3_RX_vect)
+  ISR(USART3_RX_vect)
   {
     unsigned char c = UDR3;
     store_char(c, &rx_buffer3);
   }
-#elif defined(SIG_USART3_RECV)
-  #error SIG_USART3_RECV
 #endif
 
 void serialEventRun(void)
diff -ruN arduino-1.0.1.orig/hardware/arduino/cores/arduino/HardwareSerial.h arduino-1.0.1/hardware/arduino/cores/arduino/HardwareSerial.h
--- arduino-1.0.1.orig/hardware/arduino/cores/arduino/HardwareSerial.h	2012-05-21 13:01:43.000000000 -0400
+++ arduino-1.0.1/hardware/arduino/cores/arduino/HardwareSerial.h	2012-10-19 23:13:59.000000000 -0400
@@ -76,6 +76,15 @@
   extern HardwareSerial Serial3;
 #endif
 
+/*
+ * on ATmega8, the uart and its bits are not numbered, so there is no "TXC0"
+ * definition.  It is slightly cleaner to define this here instead of having
+ * conditional code in the cpp module.
+ */
+#if !defined(TXC0)
+#define TXC0 TXC
+#endif
+
 extern void serialEventRun(void) __attribute__((weak));
 
 #endif
diff -ruN arduino-1.0.1.orig/hardware/arduino/cores/arduino/WInterrupts.c arduino-1.0.1/hardware/arduino/cores/arduino/WInterrupts.c
--- arduino-1.0.1.orig/hardware/arduino/cores/arduino/WInterrupts.c	2012-05-21 13:01:43.000000000 -0400
+++ arduino-1.0.1/hardware/arduino/cores/arduino/WInterrupts.c	2012-10-19 23:13:59.000000000 -0400
@@ -216,72 +216,72 @@
 */
 
 #if defined(__AVR_ATmega32U4__)
-SIGNAL(INT0_vect) {
+ISR(INT0_vect) {
 	if(intFunc[EXTERNAL_INT_0])
 		intFunc[EXTERNAL_INT_0]();
 }
 
-SIGNAL(INT1_vect) {
+ISR(INT1_vect) {
 	if(intFunc[EXTERNAL_INT_1])
 		intFunc[EXTERNAL_INT_1]();
 }
 
 #elif defined(EICRA) && defined(EICRB)
 
-SIGNAL(INT0_vect) {
+ISR(INT0_vect) {
   if(intFunc[EXTERNAL_INT_2])
     intFunc[EXTERNAL_INT_2]();
 }
 
-SIGNAL(INT1_vect) {
+ISR(INT1_vect) {
   if(intFunc[EXTERNAL_INT_3])
     intFunc[EXTERNAL_INT_3]();
 }
 
-SIGNAL(INT2_vect) {
+ISR(INT2_vect) {
   if(intFunc[EXTERNAL_INT_4])
     intFunc[EXTERNAL_INT_4]();
 }
 
-SIGNAL(INT3_vect) {
+ISR(INT3_vect) {
   if(intFunc[EXTERNAL_INT_5])
     intFunc[EXTERNAL_INT_5]();
 }
 
-SIGNAL(INT4_vect) {
+ISR(INT4_vect) {
   if(intFunc[EXTERNAL_INT_0])
     intFunc[EXTERNAL_INT_0]();
 }
 
-SIGNAL(INT5_vect) {
+ISR(INT5_vect) {
   if(intFunc[EXTERNAL_INT_1])
     intFunc[EXTERNAL_INT_1]();
 }
 
-SIGNAL(INT6_vect) {
+ISR(INT6_vect) {
   if(intFunc[EXTERNAL_INT_6])
     intFunc[EXTERNAL_INT_6]();
 }
 
-SIGNAL(INT7_vect) {
+ISR(INT7_vect) {
   if(intFunc[EXTERNAL_INT_7])
     intFunc[EXTERNAL_INT_7]();
 }
 
 #else
 
-SIGNAL(INT0_vect) {
+ISR(INT0_vect) {
   if(intFunc[EXTERNAL_INT_0])
     intFunc[EXTERNAL_INT_0]();
 }
 
-SIGNAL(INT1_vect) {
+ISR(INT1_vect) {
   if(intFunc[EXTERNAL_INT_1])
     intFunc[EXTERNAL_INT_1]();
 }
 
 #if defined(EICRA) && defined(ISC20)
-SIGNAL(INT2_vect) {
+ISR(INT2_vect) {
   if(intFunc[EXTERNAL_INT_2])
     intFunc[EXTERNAL_INT_2]();
 }
@@ -290,9 +290,8 @@
 #endif
 
 /*
-SIGNAL(SIG_2WIRE_SERIAL) {
+ISR(TWI_vect) {
   if(twiIntFunc)
     twiIntFunc();
 }
 */
-
diff -ruN arduino-1.0.1.orig/hardware/arduino/cores/arduino/wiring.c arduino-1.0.1/hardware/arduino/cores/arduino/wiring.c
--- arduino-1.0.1.orig/hardware/arduino/cores/arduino/wiring.c	2012-05-21 13:01:43.000000000 -0400
+++ arduino-1.0.1/hardware/arduino/cores/arduino/wiring.c	2012-10-19 23:13:59.000000000 -0400
@@ -42,9 +42,9 @@
 static unsigned char timer0_fract = 0;
 
 #if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
-SIGNAL(TIM0_OVF_vect)
+ISR(TIM0_OVF_vect)
 #else
-SIGNAL(TIMER0_OVF_vect)
+ISR(TIMER0_OVF_vect)
 #endif
 {
 	// copy these to local variables so they can be stored in registers
diff -ruN arduino-1.0.1.orig/libraries/Servo/Servo.cpp arduino-1.0.1/libraries/Servo/Servo.cpp
--- arduino-1.0.1.orig/libraries/Servo/Servo.cpp	2012-05-08 20:34:38.000000000 -0400
+++ arduino-1.0.1/libraries/Servo/Servo.cpp	2012-10-19 23:13:59.000000000 -0400
@@ -100,28 +100,28 @@
 #ifndef WIRING // Wiring pre-defines signal handlers so don't define any if compiling for the Wiring platform
 // Interrupt handlers for Arduino 
 #if defined(_useTimer1)
-SIGNAL (TIMER1_COMPA_vect) 
+ISR(TIMER1_COMPA_vect) 
 { 
   handle_interrupts(_timer1, &TCNT1, &OCR1A); 
 }
 #endif
 
 #if defined(_useTimer3)
-SIGNAL (TIMER3_COMPA_vect) 
+ISR(TIMER3_COMPA_vect) 
 { 
   handle_interrupts(_timer3, &TCNT3, &OCR3A); 
 }
 #endif
 
 #if defined(_useTimer4)
-SIGNAL (TIMER4_COMPA_vect) 
+ISR(TIMER4_COMPA_vect) 
 {
   handle_interrupts(_timer4, &TCNT4, &OCR4A); 
 }
 #endif
 
 #if defined(_useTimer5)
-SIGNAL (TIMER5_COMPA_vect) 
+ISR(TIMER5_COMPA_vect) 
 {
   handle_interrupts(_timer5, &TCNT5, &OCR5A); 
 }
diff -ruN arduino-1.0.1.orig/libraries/Wire/utility/twi.c arduino-1.0.1/libraries/Wire/utility/twi.c
--- arduino-1.0.1.orig/libraries/Wire/utility/twi.c	2012-02-18 19:57:03.000000000 -0500
+++ arduino-1.0.1/libraries/Wire/utility/twi.c	2012-10-19 23:13:59.000000000 -0400
@@ -360,7 +360,7 @@
   twi_state = TWI_READY;
 }
 
-SIGNAL(TWI_vect)
+ISR(TWI_vect)
 {
   switch(TW_STATUS){
     // All Master