From ee4ceec3d96375f9ca6ba4816ade7508bd570a92 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 4 Sep 2019 11:45:19 +0800 Subject: [PATCH] 1 --- a8/xtimer.cc | 7 +++++-- a8/xtimer.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/a8/xtimer.cc b/a8/xtimer.cc index f668d64..7dba959 100644 --- a/a8/xtimer.cc +++ b/a8/xtimer.cc @@ -254,9 +254,12 @@ namespace a8 } } - a8::XParams& XTimer::GetTimerXParams(xtimer_list* timer) + a8::XParams* XTimer::MutableParams(xtimer_list* timer) { - return timer->param; + if (!timer) { + abort(); + } + return &timer->param; } xtimer_list* XTimer::GetRunningTimer() diff --git a/a8/xtimer.h b/a8/xtimer.h index e63d710..fe5f8c6 100644 --- a/a8/xtimer.h +++ b/a8/xtimer.h @@ -40,7 +40,7 @@ namespace a8 void DeleteTimer(xtimer_list* timer); //通过关联的list_head获取定时器对象 xtimer_list* GetTimerByAttach(list_head* attach_entry); - a8::XParams& GetTimerXParams(xtimer_list* timer); + a8::XParams* MutableParams(xtimer_list* timer); xtimer_list* GetRunningTimer(); private: