add GetRunningTimer
This commit is contained in:
parent
5a09680103
commit
33fec01526
@ -228,6 +228,9 @@ namespace a8
|
|||||||
|
|
||||||
void XTimer::DeleteTimer(xtimer_list* timer)
|
void XTimer::DeleteTimer(xtimer_list* timer)
|
||||||
{
|
{
|
||||||
|
if (!timer) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
if (base_->running_timer == timer) {
|
if (base_->running_timer == timer) {
|
||||||
base_->running_timer = nullptr;
|
base_->running_timer = nullptr;
|
||||||
}
|
}
|
||||||
@ -256,6 +259,11 @@ namespace a8
|
|||||||
return timer->param;
|
return timer->param;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xtimer_list* XTimer::GetRunningTimer()
|
||||||
|
{
|
||||||
|
return base_->running_timer;
|
||||||
|
}
|
||||||
|
|
||||||
void XTimer::UpdateTimer()
|
void XTimer::UpdateTimer()
|
||||||
{
|
{
|
||||||
struct xtvec_base *base = base_;
|
struct xtvec_base *base = base_;
|
||||||
|
@ -41,6 +41,7 @@ namespace a8
|
|||||||
//通过关联的list_head获取定时器对象
|
//通过关联的list_head获取定时器对象
|
||||||
xtimer_list* GetTimerByAttach(list_head* attach_entry);
|
xtimer_list* GetTimerByAttach(list_head* attach_entry);
|
||||||
a8::XParams& GetTimerXParams(xtimer_list* timer);
|
a8::XParams& GetTimerXParams(xtimer_list* timer);
|
||||||
|
xtimer_list* GetRunningTimer();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void UpdateTimer();
|
void UpdateTimer();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user