MQX4.0.1 _timer_cancle() alwasy return MQX_INVALID_PARAMETER?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX4.0.1 _timer_cancle() alwasy return MQX_INVALID_PARAMETER?

Jump to solution
616 Views
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 Kudos
1 Solution
466 Views
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?

View solution in original post

0 Kudos
3 Replies
466 Views
elsoft
Contributor I

Hi

I have the same problem

any news?

Thank you

0 Kudos
466 Views
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 Kudos
467 Views
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 Kudos