summaryrefslogtreecommitdiff
path: root/java/arduino/avrlibc-signals.patch
blob: d9c743cc69563e79923b5824156ed8090b1f82ca (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
diff -ruN arduino-1.0.2.orig/hardware/arduino/cores/arduino/HardwareSerial.cpp arduino-1.0.2/hardware/arduino/cores/arduino/HardwareSerial.cpp
--- arduino-1.0.2.orig/hardware/arduino/cores/arduino/HardwareSerial.cpp	2012-11-04 16:29:10.000000000 -0500
+++ arduino-1.0.2/hardware/arduino/cores/arduino/HardwareSerial.cpp	2012-12-03 15:35:06.000000000 -0500
@@ -89,9 +89,7 @@
 #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));
@@ -99,14 +97,8 @@
   #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)
 #elif defined(USART0_RX_vect)
   SIGNAL(USART0_RX_vect)
-#elif defined(SIG_UART_RECV)
-  SIGNAL(SIG_UART_RECV)
 #endif
   {
   #if defined(UDR0)
@@ -143,8 +135,6 @@
       unsigned char c = UDR1;
     };
   }
-#elif defined(SIG_USART1_RECV)
-  #error SIG_USART1_RECV
 #endif
 
 #if defined(USART2_RX_vect) && defined(UDR2)
@@ -160,8 +150,6 @@
       unsigned char c = UDR2;
     };
   }
-#elif defined(SIG_USART2_RECV)
-  #error SIG_USART2_RECV
 #endif
 
 #if defined(USART3_RX_vect) && defined(UDR3)
@@ -177,8 +165,6 @@
       unsigned char c = UDR3;
     };
   }
-#elif defined(SIG_USART3_RECV)
-  #error SIG_USART3_RECV
 #endif
 
 void serialEventRun(void)
diff -ruN arduino-1.0.2.orig/hardware/arduino/cores/arduino/HardwareSerial.h arduino-1.0.2/hardware/arduino/cores/arduino/HardwareSerial.h
--- arduino-1.0.2.orig/hardware/arduino/cores/arduino/HardwareSerial.h	2012-11-04 16:29:10.000000000 -0500
+++ arduino-1.0.2/hardware/arduino/cores/arduino/HardwareSerial.h	2012-12-03 15:35:06.000000000 -0500
@@ -126,6 +126,15 @@
 #endif
 #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.2.orig/hardware/arduino/cores/arduino/WInterrupts.c arduino-1.0.2/hardware/arduino/cores/arduino/WInterrupts.c
--- arduino-1.0.2.orig/hardware/arduino/cores/arduino/WInterrupts.c	2012-11-04 16:29:11.000000000 -0500
+++ arduino-1.0.2/hardware/arduino/cores/arduino/WInterrupts.c	2012-12-03 15:37:08.000000000 -0500
@@ -314,7 +314,7 @@
 #endif
 
 /*
-SIGNAL(SIG_2WIRE_SERIAL) {
+ISR(TWI_vect) {
   if(twiIntFunc)
     twiIntFunc();
 }