Is it possible to read the value of a lwevent?

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

Is it possible to read the value of a lwevent?

Jump to solution
1,237 Views
JaimeR
Contributor III

If yes,  how? and would I need extra protection to avoid accessing the value of the event at the same time by different tasks?

 

Regards,

0 Kudos
Reply
1 Solution
634 Views
JuroV
NXP Employee
NXP Employee

First of all, reading value of any synchronization object (e.g. lwevent) is not task-safe and handling with those objects should be done only through blocking / setting functions.

To fulfill your request, I reply that if you want to read value of lwevent, use:

 

LWEVENT_STRUCT some_event;

/* some initialization code here, out of scope */

_mqx_uint lwe_val = some_event.VALUE;

 

 

 

Message Edited by JuroV on 2009-10-05 10:17 AM

View solution in original post

0 Kudos
Reply
1 Reply
635 Views
JuroV
NXP Employee
NXP Employee

First of all, reading value of any synchronization object (e.g. lwevent) is not task-safe and handling with those objects should be done only through blocking / setting functions.

To fulfill your request, I reply that if you want to read value of lwevent, use:

 

LWEVENT_STRUCT some_event;

/* some initialization code here, out of scope */

_mqx_uint lwe_val = some_event.VALUE;

 

 

 

Message Edited by JuroV on 2009-10-05 10:17 AM
0 Kudos
Reply