Is it possible to read the value of a lwevent?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Is it possible to read the value of a lwevent?

跳至解决方案
1,222 次查看
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 项奖励
回复
1 解答
619 次查看
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 项奖励
回复
1 回复
620 次查看
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 项奖励
回复