Commit 5af847d
committed
In SoftwareSerial, use ISR_ALIASOF to prevent duplication
Previously, up to four separate but identical ISR routines were defined,
for PCINT0, PCINT1, PCINT2 and PCINT3. Each of these would generate
their own function, with a lot of push-popping because another function
was called.
Now, the ISR_ALIASOF macro from avr-libc is used to declare just the
PCINT0 version and make all other ISRs point to that one, saving a lot
of program space, as well as some speed because of improved inlining.
On an Arduino Uno with gcc 4.3, this saves 168 bytes. With gcc 4.8, this
saves 150 bytes.1 parent 87f89f6 commit 5af847d
File tree
1 file changed
+3
-12
lines changed- hardware/arduino/avr/libraries/SoftwareSerial
1 file changed
+3
-12
lines changedLines changed: 3 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
| 319 | + | |
323 | 320 | | |
324 | 321 | | |
325 | 322 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
| 323 | + | |
330 | 324 | | |
331 | 325 | | |
332 | 326 | | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
| 327 | + | |
337 | 328 | | |
338 | 329 | | |
339 | 330 | | |
| |||
0 commit comments