add SoftwareTimer setID/getID

This commit is contained in:
hathach committed 2020-01-22 17:18:06 +07:00
1 parent d65f1cd720
commit 25232734f9
2 files changed
+13

No files matched your search

+10
View File
@@ -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;
+3
View File
@@ -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);