Several MQX event functions (e.g. _event_wait_all, _event_clear, _event_set) have an argument _mqx_uint bit_mask.
The reference manual only gives a cryptic definition for this argument:
"Each set bit represents an event bit to clear"
Most of the examples use the constant 0x01 for the bit_mask argument, so there is no help there.
Does anyone know precisely what this argument does?
Solved! Go to Solution.
A good summary of using the event flags is to have the capability to AND/OR bits to create unique triggers or simple triggers.
Regards,
David
Thanks. I'll look forward.
It seems like what it is saying is I can have one single event pointer, but multiple "flags" within it. So, for example, I could set one bit when a pressure reaches 300 bar, and another when it falls below 50 bar. If I a event waiting for both bits it would be triggered after the rise and fall (talking pressures here, not the roman empire). Nice feature.
A good summary of using the event flags is to have the capability to AND/OR bits to create unique triggers or simple triggers.
Regards,
David
That is an extremely concise yet detailed answer! Thank you very much!!
Is there a master document that you took this from? Finding a document with concise and detailed explanations of some of the functions would be akin to finding a lost Monet.
The FreescaleMQX4_0_2\docs\mqx\MQXUG.pdf does a very good job of explaining the RTOS features and capabilities without getting too deep but it doesn't boil it down to one slide as shown above. Therefore the reason for the slide ;-)
Regards,
David
Hello Steve Janisch,
I'll paste here a snippet from the event code file, where is a condition to check bit_mask. This should clear the confusion. Line 2344 if you want to further investigate what it does inside.
if ((all && ((event_ptr->EVENT & bit_mask) != bit_mask)) || (!all && ((event_ptr->EVENT & bit_mask) == 0)))
{
/* code */
}
I believe examples uses only one event thus (0x01) . |
Regards,
0xc0170