You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cores/arduino/HardwareTimer.h
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -126,14 +126,16 @@ class HardwareTimer {
126
126
voidsetInterruptPriority(uint32_t preemptPriority, uint32_t subPriority); // set interrupt priority
127
127
128
128
//Add interrupt to period update
129
-
voidattachInterrupt(void (*handler)(HardwareTimer *)); // Attach interrupt callback which will be called upon update event (timer rollover)
129
+
voidattachInterrupt(void (*handler)(HardwareTimer *), void *arg = NULL); // Attach interrupt callback which will be called upon update event (timer rollover)
130
130
voiddetachInterrupt(); // remove interrupt callback which was attached to update event
131
131
boolhasInterrupt(); //returns true if a timer rollover interrupt has already been set
132
132
//Add interrupt to capture/compare channel
133
-
voidattachInterrupt(uint32_t channel, void (*handler)(HardwareTimer *)); // Attach interrupt callback which will be called upon compare match event of specified channel
133
+
voidattachInterrupt(uint32_t channel, void (*handler)(HardwareTimer *), void *arg = NULL); // Attach interrupt callback which will be called upon compare match event of specified channel
134
134
voiddetachInterrupt(uint32_t channel); // remove interrupt callback which was attached to compare match event of specified channel
135
135
boolhasInterrupt(uint32_t channel); //returns true if an interrupt has already been set on the channel compare match
// Refresh() is usefull while timer is running after some registers update
@@ -152,6 +154,8 @@ class HardwareTimer {
152
154
TimerModes_t _ChannelMode[TIMER_CHANNELS];
153
155
timerObj_t _timerObj;
154
156
void (*callbacks[1 + TIMER_CHANNELS])(HardwareTimer *); //Callbacks: 0 for update, 1-4 for channels. (channel5/channel6, if any, doesn't have interrupt)
0 commit comments