lwevent functionality in a task

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

lwevent functionality in a task

640 Views
norbertoj
Contributor III

Hi!!!!

I have som problems with _lewent_wait. I have a task that do two things, First, configure some buttons (Enable, Disable in SW, in a uint8 variable) for request of other task (control task),; second, detect an event (pressed or released) and report it to control task. My problem is that if I use _lewent wait_ticks, the code blocks in only waiting an event, and doesn't read the messages of control task. Is there other way with the library of lwevent?

Sincerely,

Norberto Jiménez

0 Kudos
Reply
2 Replies

535 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Norberto:

Yes, waiting on event bit is a blocking call.  Any task can set or clear bits event field,  or interrupt service routine can also set or clear bits. once the condition specified to unblock  is being met, the task state will change from blocked to ready, and the scheduler will be called to see whether a context switch should be done.

Please refer to the following demo for lwevent usage.

C:\Freescale\Freescale_MQX_4_2\mqx\examples\lwevent

Regards

Daniel

0 Kudos
Reply

535 Views
norbertoj
Contributor III

Hi Daniel.

I have my task waiting for an event bit(_lwevent_wait_ticks() ) from a function that check if a button is pressed. I have another task that send a message (Create from _lwmsgq_init() ) in order to configure some characteristics of the button. I don't know if there is a way to unlock the task without use _lwevent_set(), like _task_ready(). Or , Is better assigned another event bit, and get the mask event bits?

Regards,

Norberto.

0 Kudos
Reply