virtual/monkeysphere-validation-agent: Drop Monkeysphere
[wtk-overlay.git] / dev-embedded / simulavr / files / 9999-0010-update_poisoned_interrupt_vectors.patch
1 bug #35737: new awr-gcc is picky about depreciated constants
2 http://savannah.nongnu.org/bugs/?35737
3
4 diff --git a/examples/atmega128_timer/main.c b/examples/atmega128_timer/main.c
5 index 15661d7..d666ac0 100644
6 --- a/examples/atmega128_timer/main.c
7 +++ b/examples/atmega128_timer/main.c
8 @@ -5,7 +5,7 @@
9  volatile int timer2_ticks;
10  
11  /* Every ~ms */
12 -ISR(SIG_OUTPUT_COMPARE2)
13 +ISR(TIMER2_COMP_vect)
14  {                               /* Every ~1ms */
15     timer2_ticks++;
16  }
17 diff --git a/examples/atmel_key/StdDefs.c b/examples/atmel_key/StdDefs.c
18 index 738f84c..556d6ff 100644
19 --- a/examples/atmel_key/StdDefs.c
20 +++ b/examples/atmel_key/StdDefs.c
21 @@ -54,14 +54,6 @@ void test_pin(void)
22         sbi(TESTPIN_PORT, TESTPIN_BIT);
23     }
24  
25 -// Delay in 1/10's of a millisecond
26 -// Does not work with -O0, use -O1, even for debugging.
27 -void msleep(INT16U ms10)
28 -    {
29 -        for( ; ms10; --ms10)
30 -            _delay_ms(0.1);
31 -    }
32 -
33  //------------------------------------------------------------
34  // void putBCD(INT16S X, CHARU length, CHARU TrailingSpace)
35  //
36 diff --git a/examples/atmel_key/StdDefs.h b/examples/atmel_key/StdDefs.h
37 index 9ae8b91..38ea1d8 100644
38 --- a/examples/atmel_key/StdDefs.h
39 +++ b/examples/atmel_key/StdDefs.h
40 @@ -63,8 +63,8 @@ void print_hexbyte(unsigned char i);
41     #define UART_BAUD_REG_H      UBRR0H
42     #define UART_CONTROL_REG     UCSR0B
43     #define UART_STATUS_REG      UCSR0A
44 -   #define UART_RCV_INT_VECTOR  SIG_UART0_RECV
45 -   #define UART_REG_EMPTY_INT_VECTOR  SIG_UART0_DATA
46 +   #define UART_RCV_INT_VECTOR  USART0_RX_vect
47 +   #define UART_REG_EMPTY_INT_VECTOR  USART0_UDRE_vect
48     #define UART_DATA_REG        UDR0
49  #elif DEVICE_NAME == ATMEGA163
50     #define UART_BAUD_REG        UBRR
51 diff --git a/examples/atmel_key/kb.c b/examples/atmel_key/kb.c
52 index 322b443..77edaa2 100644
53 --- a/examples/atmel_key/kb.c
54 +++ b/examples/atmel_key/kb.c
55 @@ -36,7 +36,7 @@ void init_kb(void)
56      bitcount = 11;
57  }
58  
59 -SIGNAL(SIG_INTERRUPT0)
60 +SIGNAL(INT0_vect)
61  {
62      static unsigned char data;                // Holds the received scan code
63  
64 diff --git a/examples/atmel_key/main.c b/examples/atmel_key/main.c
65 index 5fb551a..47a2221 100644
66 --- a/examples/atmel_key/main.c
67 +++ b/examples/atmel_key/main.c
68 @@ -5,6 +5,7 @@
69  // PS-1 Keyboard interface test program
70  
71  #include <avr/io.h>
72 +#include <util/delay.h>
73  #include <stdlib.h>
74  //include <sig-avr.h>
75  #include <avr/interrupt.h>
76 @@ -31,7 +32,7 @@ int main(void)
77      {
78          key=getchar();
79          putchar(key);
80 -        msleep(10);
81 +        _delay_ms(10);
82      }
83      return 1;
84  }
85 diff --git a/examples/atmel_key/scancodes.h b/examples/atmel_key/scancodes.h
86 index a9375f3..f39474b 100644
87 --- a/examples/atmel_key/scancodes.h
88 +++ b/examples/atmel_key/scancodes.h
89 @@ -15,7 +15,7 @@
90  
91  // Unshifted characters
92  
93 -static char unshifted[][2]  __attribute__ ((progmem)) = {
94 +static const char unshifted[][2] PROGMEM = {
95  0x0d,9,
96  0x0e,'`',
97  0x15,'q',
98 @@ -87,7 +87,7 @@ static char unshifted[][2]  __attribute__ ((progmem)) = {
99  };
100  
101  // Shifted characters
102 -prog_char shifted[][2] = {
103 +static const char shifted[][2] PROGMEM = {
104  0x0d,9,
105  0x0e,'~',
106  0x15,'Q',
107 diff --git a/examples/python/ex_pinout.c b/examples/python/ex_pinout.c
108 index 0bea2e0..7e55392 100644
109 --- a/examples/python/ex_pinout.c
110 +++ b/examples/python/ex_pinout.c
111 @@ -3,7 +3,7 @@
112  
113  volatile int timer2_ticks;
114  
115 -ISR(SIG_OUTPUT_COMPARE2) {
116 +ISR(TIMER2_COMP_vect) {
117     timer2_ticks++;
118  }
119  
120 diff --git a/examples/python/example.c b/examples/python/example.c
121 index bfd7509..35931b5 100644
122 --- a/examples/python/example.c
123 +++ b/examples/python/example.c
124 @@ -4,7 +4,7 @@
125  volatile int timer2_ticks;
126  
127  /* Every ~ms */
128 -ISR(SIG_OUTPUT_COMPARE2) {
129 +ISR(TIMER2_COMP_vect) {
130     timer2_ticks++;
131  }
132  
133 diff --git a/examples/python/example_io.c b/examples/python/example_io.c
134 index 3822b41..71c932e 100644
135 --- a/examples/python/example_io.c
136 +++ b/examples/python/example_io.c
137 @@ -5,7 +5,7 @@ volatile int timer2_ticks;
138  volatile int port_val;
139  volatile int port_cnt;
140  
141 -ISR(SIG_OUTPUT_COMPARE2) {
142 +ISR(TIMER2_COMP_vect) {
143     timer2_ticks++;
144  }
145  
146 diff --git a/examples/python/multicore.c b/examples/python/multicore.c
147 index 2df7443..869563e 100644
148 --- a/examples/python/multicore.c
149 +++ b/examples/python/multicore.c
150 @@ -11,7 +11,7 @@
151  volatile char cnt_irq = 0;         // IRQ counter\r
152  volatile char cnt_res = 0;         // measurement value for time distance between events\r
153  \r
154 -ISR(SIG_INTERRUPT0) {\r
155 +ISR(INT0_vect) {\r
156    cnt_irq++;                       // increment event counter\r
157    cnt_res = TCNT0;                 // save timer value = time distance to last event\r
158    TCNT0 = 0;                       // reset timer value\r
159 diff --git a/regress/extinttest/ext_int0.c b/regress/extinttest/ext_int0.c
160 index 9a619c2..a12304a 100644
161 --- a/regress/extinttest/ext_int0.c
162 +++ b/regress/extinttest/ext_int0.c
163 @@ -89,12 +89,12 @@ volatile unsigned char hs_data = 0;
164  volatile unsigned char dis_mask = 0;
165  
166  #if defined(TEST_INT1)
167 -  ISR(SIG_INTERRUPT1) {
168 +  ISR(INT1_vect) {
169  #else
170  # if defined(TEST_INT2_16)
171 -  ISR(SIG_INTERRUPT2) {
172 +  ISR(INT2_vect) {
173  # else
174 -  ISR(SIG_INTERRUPT0) {
175 +  ISR(INT0_vect) {
176  # endif
177  #endif
178    cnt_irq++;
179 diff --git a/regress/timertest/timer_16bit.c b/regress/timertest/timer_16bit.c
180 index c3accf2..bcdd27b 100644
181 --- a/regress/timertest/timer_16bit.c
182 +++ b/regress/timertest/timer_16bit.c
183 @@ -7,7 +7,7 @@ volatile int timer_ticks;
184  ISR(SIG_OVERFLOW3) {
185     timer_ticks++;
186  }
187 -ISR(SIG_OUTPUT_COMPARE3B) {
188 +ISR(TIMER3_COMPB_vect) {
189     timer_ticks++;
190  }
191  #else
192 diff --git a/regress/timertest/timer_8bit_ctc.c b/regress/timertest/timer_8bit_ctc.c
193 index 1b9c969..7341336 100644
194 --- a/regress/timertest/timer_8bit_ctc.c
195 +++ b/regress/timertest/timer_8bit_ctc.c
196 @@ -4,11 +4,11 @@
197  volatile int timer_ticks;
198  
199  #ifdef PROC_atmega48
200 -ISR(SIG_OUTPUT_COMPARE2A) {
201 +ISR(TIMER2_COMPA_vect) {
202     timer_ticks++;
203  }
204  #else
205 -ISR(SIG_OUTPUT_COMPARE2) {
206 +ISR(TIMER2_COMP_vect) {
207     timer_ticks++;
208  }
209  #endif