AnsweredAssumed Answered

MQX Event Related Query

Question asked by Utsavi Kalpesh Bharuchwala on Nov 26, 2014
Latest reply on Nov 26, 2014 by soledad

Hi,

 

I am working with Codewarrior v10.6 and of MQX v4.0 and created a project in which I need to set event.

 

To set Event I have taken an array of 16bit vector and set it.


for example,

 

///////////////////////////////////////////////////////////////////////////////

 

Task 1 :

 

uint_16 EventVector;

 

//say EventVector at a moment is 0x0080. EventVector is changing continuously.

 

//Bits of EventVector will set according to condition,,,,,,,,,

while(1)

{

 

////my stuff........

if(condition)

     _event_set(event_ptr,EventVector); //event is conditionally set

}

 

///////////////////////////////////////////////////////////////////////////////

 

Task 2

while(1)

{

 

_event_wait_all_ticks(event_ptr, EventVector, 0);

//my stuff..........

printf("1 \n");

 

_event_clear(event_ptr,EventVector);

}

 

///////////////////////////////////////////////////////////////////////////////

 

That is what I have written with event create and all the other stuff in my project.

 

The problem is,  Task 2 is not waiting for the event. It is printing "1" all the time whether event is set or not.

 

But when I am writing like

 

///////////////////////////////////////////////////////////////////////////////

 

Task 1 :

 

uint_16 EventVector;

 

//say EventVector at a moment is 0x0080. EventVector is changing continuously.

 

//Bits of EventVector will set according to condition,,,,,,,,,

while(1)

{

 

////my stuff........

if(condition)

     _event_set(event_ptr,0x01); //event is conditionally set

}

 

///////////////////////////////////////////////////////////////////////////////

 

Task 2

while(1)

{

 

_event_wait_all_ticks(event_ptr, 0x01, 0);

//my stuff..........

printf("1 \n");

 

_event_clear(event_ptr,0x01);

}

 

///////////////////////////////////////////////////////////////////////////////

 

then "1" will be printed only when the even is set.

 

why its is so??Can anybosy tell me how to pass the dynamically data into event...???

 

Please don't suggest me to see the demo of Event in MQX which is , I have already seen and made the project.

 

Plz help...

Outcomes