From 33857e9ed3180e9dd3c9b69a3cbd958b3008520c Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 13 Nov 2019 16:56:44 +0700 Subject: [PATCH] add timer ID support to software timer --- cores/nRF5/utility/SoftwareTimer.cpp | 4 ++-- cores/nRF5/utility/SoftwareTimer.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cores/nRF5/utility/SoftwareTimer.cpp b/cores/nRF5/utility/SoftwareTimer.cpp index d86a0490..84c64c0e 100644 --- a/cores/nRF5/utility/SoftwareTimer.cpp +++ b/cores/nRF5/utility/SoftwareTimer.cpp @@ -34,9 +34,9 @@ SoftwareTimer::~SoftwareTimer () if ( _handle != NULL ) xTimerDelete(_handle, 0); } -void SoftwareTimer::begin(uint32_t ms, TimerCallbackFunction_t callback, bool repeating) +void SoftwareTimer::begin(uint32_t ms, TimerCallbackFunction_t callback, void* timerID, bool repeating) { - _handle = xTimerCreate(NULL, ms2tick(ms), repeating, NULL, callback); + _handle = xTimerCreate(NULL, ms2tick(ms), repeating, timerID, callback); } bool SoftwareTimer::start(void) diff --git a/cores/nRF5/utility/SoftwareTimer.h b/cores/nRF5/utility/SoftwareTimer.h index 7649187c..24453c49 100644 --- a/cores/nRF5/utility/SoftwareTimer.h +++ b/cores/nRF5/utility/SoftwareTimer.h @@ -47,7 +47,7 @@ class SoftwareTimer SoftwareTimer(); virtual ~SoftwareTimer(); - void begin(uint32_t ms, TimerCallbackFunction_t callback, bool repeating = true); + void begin(uint32_t ms, TimerCallbackFunction_t callback, void* timerID = NULL, bool repeating = true); TimerHandle_t getHandle(void) { return _handle; } bool start(void);