-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit 3c6d386
committed
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 5755dde commit 3c6d386
3 files changed
+17
-5
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
148 | 148 |
| |
149 | 149 |
| |
150 | 150 |
| |
151 | + | ||
151 | 152 |
| |
152 | 153 |
| |
153 | 154 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 | - | ||
35 | + | ||
36 | + | ||
37 | + | ||
36 | 38 |
| |
37 | 39 |
| |
38 | - | ||
40 | + | ||
39 | 41 |
| |
40 | 42 |
| |
41 | 43 |
| |
| |||
65 | 67 |
| |
66 | 68 |
| |
67 | 69 |
| |
70 | + | ||
68 | 71 |
| |
69 | 72 |
| |
73 | + | ||
74 | + | ||
75 | + | ||
76 | + | ||
77 | + | ||
78 | + | ||
79 | + | ||
80 | + | ||
70 | 81 |
| |
71 | 82 |
| |
83 | + | ||
72 | 84 |
| |
73 | 85 |
| |
74 | 86 |
| |
| |||
270 | 282 |
| |
271 | 283 |
| |
272 | 284 |
| |
285 | + | ||
273 | 286 |
| |
274 | 287 |
| |
275 | 288 |
| |
276 | 289 |
| |
277 | 290 |
| |
278 | 291 |
| |
279 | - | ||
292 | + | ||
280 | 293 |
| |
281 | 294 |
| |
282 | 295 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
66 | - | ||
67 | - | ||
68 | 66 |
| |
69 | 67 |
| |
70 | 68 |
| |
|
0 commit comments