MQX4.0.1 _timer_cancle() alwasy return MQX_INVALID_PARAMETER?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MQX4.0.1 _timer_cancle() alwasy return MQX_INVALID_PARAMETER?

ソリューションへジャンプ
888件の閲覧回数
danielchai
Senior Contributor I

Hi,

I am using MQX4.0.1, CW10.4.

I created a timer component using
_timer_create_component(TIMER_TASK_PRIORITY, TIMER_STACK_SIZE);

and start the timer using

timerID = _timer_start_oneshot_after((void *)sleep_timer_timeout, 0, TIMER_ELAPSED_TIME_MODE, ui32Timems);

but when I am using _timer_cancle(timerID) , it always return 0x0c.

I check  the timerID is 2, and replace _timer_cancle(timerID) by _timer_cancle(2), it returns 0x00.

I can't figure it out why _timer_cancle(timerID) returns 0x0c. Please advice.

Thank you.

0 件の賞賛
返信
1 解決策
738件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

HI

I implemented the same code according to your setting, but I got the 0x00 every time. I suggest you check the variable "timerID",  is it used by other function?

or did you cancel the timer  before creating it successfully?

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
738件の閲覧回数
elsoft
Contributor I

Hi

I have the same problem

any news?

Thank you

0 件の賞賛
返信
738件の閲覧回数
danielchai
Senior Contributor I

Hi,

I checked it.

The reason causing that is because it is used by another task.

Maybe you can check to see if other tasks still using it.

-Daniel

0 件の賞賛
返信
739件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

HI

I implemented the same code according to your setting, but I got the 0x00 every time. I suggest you check the variable "timerID",  is it used by other function?

or did you cancel the timer  before creating it successfully?

0 件の賞賛
返信