cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with creating event flag in ThreadX

mahirmahota
Associate III

When I call the tx_event_flags_create() function, the code returns an error at the following line:

 else if (event_control_block_size != (sizeof(TX_EVENT_FLAGS_GROUP)))
    {

        /* Event flags group pointer is invalid, return appropriate error code.  */
        status =  TX_GROUP_ERROR;
    }

I'm not sure why this would be a problem since I only have one TX_EVENT_FLAGS_GROUP defined in my program as far as I can see and the size of the struct passed in should match. Is there anything I could possibly be missing here?

1 REPLY 1
mbarg.1
Senior III

Add the code where you declare global

TX_EVENT_FLAGS_GROUP   event_control_block

 

add code where you compute 

event_control_block_size 

and code tx_event_flags_create() ... and i will show you where is the problem ! 

Or double check:

you need to have a global variable with the structure TX_EVENT_FLAGS_GROUP 

+ pass the address of this variable (not the variable) to tx_event_flags_create()

+ tx_event_flags_create() returns a success code, TX_SUCCESS if everithing is ok or an error code !