Skip to content

Commit 33857e9

Browse files
committed
add timer ID support to software timer
1 parent 54c87e8 commit 33857e9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cores/nRF5/utility/SoftwareTimer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ SoftwareTimer::~SoftwareTimer ()
3434
if ( _handle != NULL ) xTimerDelete(_handle, 0);
3535
}
3636

37-
void SoftwareTimer::begin(uint32_t ms, TimerCallbackFunction_t callback, bool repeating)
37+
void SoftwareTimer::begin(uint32_t ms, TimerCallbackFunction_t callback, void* timerID, bool repeating)
3838
{
39-
_handle = xTimerCreate(NULL, ms2tick(ms), repeating, NULL, callback);
39+
_handle = xTimerCreate(NULL, ms2tick(ms), repeating, timerID, callback);
4040
}
4141

4242
bool SoftwareTimer::start(void)

cores/nRF5/utility/SoftwareTimer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class SoftwareTimer
4747
SoftwareTimer();
4848
virtual ~SoftwareTimer();
4949

50-
void begin(uint32_t ms, TimerCallbackFunction_t callback, bool repeating = true);
50+
void begin(uint32_t ms, TimerCallbackFunction_t callback, void* timerID = NULL, bool repeating = true);
5151
TimerHandle_t getHandle(void) { return _handle; }
5252

5353
bool start(void);

0 commit comments

Comments
 (0)