-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit c26f0ca
author
committedPaulo Costa
Support extra parameter on
When writing an arduino library, it is difficult to connect interrupt handlers with the component instance that should be notified.
In C, the common pattern to fix this is to specifying a `void*` parameter with the callback, where the listener can store any context necessary.
This patch adds the new function `attachInterruptParam()` to implement this pattern.attachInterrupt()
1 parent cd9a6ec commit c26f0ca
File tree
3 files changed
+18
-3
lines changed- hardware/arduino/avr/cores/arduino
3 files changed
+18
-3
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
140 | 140 |
| |
141 | 141 |
| |
142 | 142 |
| |
143 | + | ||
143 | 144 |
| |
144 | 145 |
| |
145 | 146 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
38 | - | ||
38 | + | ||
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
| |||
65 | 65 |
| |
66 | 66 |
| |
67 | 67 |
| |
68 | + | ||
68 | 69 |
| |
69 | 70 |
| |
70 | - | ||
71 | + | ||
72 | + | ||
73 | + | ||
74 | + | ||
75 | + | ||
76 | + | ||
77 | + | ||
78 | + | ||
79 | + | ||
80 | + | ||
81 | + | ||
71 | 82 |
| |
72 | 83 |
| |
84 | + | ||
73 | 85 |
| |
74 | 86 |
| |
75 | 87 |
| |
| |||
271 | 283 |
| |
272 | 284 |
| |
273 | 285 |
| |
286 | + | ||
274 | 287 |
| |
275 | 288 |
| |
276 | 289 |
| |
| |||
282 | 295 |
| |
283 | 296 |
| |
284 | 297 |
| |
285 | - | ||
298 | + | ||
286 | 299 |
| |
287 | 300 |
| |
288 | 301 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
67 | + | ||
67 | 68 |
| |
68 | 69 |
| |
69 | 70 |
| |
|
0 commit comments