add GetRunningTimer

This commit is contained in:
aozhiwei 2019-09-04 11:21:38 +08:00
parent 5a09680103
commit 33fec01526
2 changed files with 9 additions and 0 deletions

View File

@ -228,6 +228,9 @@ namespace a8
void XTimer::DeleteTimer(xtimer_list* timer)
{
if (!timer) {
abort();
}
if (base_->running_timer == timer) {
base_->running_timer = nullptr;
}
@ -256,6 +259,11 @@ namespace a8
return timer->param;
}
xtimer_list* XTimer::GetRunningTimer()
{
return base_->running_timer;
}
void XTimer::UpdateTimer()
{
struct xtvec_base *base = base_;

View File

@ -41,6 +41,7 @@ namespace a8
//通过关联的list_head获取定时器对象
xtimer_list* GetTimerByAttach(list_head* attach_entry);
a8::XParams& GetTimerXParams(xtimer_list* timer);
xtimer_list* GetRunningTimer();
private:
void UpdateTimer();