diff --git a/cores/nRF5/utility/SoftwareTimer.cpp b/cores/nRF5/utility/SoftwareTimer.cpp index 9a73706c..f5899a0f 100644 --- a/cores/nRF5/utility/SoftwareTimer.cpp +++ b/cores/nRF5/utility/SoftwareTimer.cpp @@ -39,6 +39,16 @@ void SoftwareTimer::begin(uint32_t ms, TimerCallbackFunction_t callback, void* t _handle = xTimerCreate(NULL, ms2tick(ms), repeating, timerID, callback); } +void SoftwareTimer::setID(void* id) +{ + vTimerSetTimerID(_handle, id); +} + +void* SoftwareTimer::getID(void) +{ + return pvTimerGetTimerID(_handle); +} + bool SoftwareTimer::start(void) { bool ret = true; diff --git a/cores/nRF5/utility/SoftwareTimer.h b/cores/nRF5/utility/SoftwareTimer.h index 24453c49..2216d98e 100644 --- a/cores/nRF5/utility/SoftwareTimer.h +++ b/cores/nRF5/utility/SoftwareTimer.h @@ -50,6 +50,9 @@ class SoftwareTimer void begin(uint32_t ms, TimerCallbackFunction_t callback, void* timerID = NULL, bool repeating = true); TimerHandle_t getHandle(void) { return _handle; } + void setID(void* id); + void* getID(void); + bool start(void); bool stop (void); bool reset (void);