Robobo
xEventGroupCreate

event_groups.h

EventGroupHandle_t xEventGroupCreate( void );

Create a new event group. This function cannot be called from an interrupt.

Although event groups are not related to ticks, for internal implementation reasons the number of bits available for use in an event group is dependent on the configUSE_16_BIT_TICKS setting in FreeRTOSConfig.h. If configUSE_16_BIT_TICKS is 1 then each event group contains 8 usable bits (bit 0 to bit 7). If configUSE_16_BIT_TICKS is set to 0 then each event group has 24 usable bits (bit 0 to bit 23). The EventBits_t type is used to store event bits within an event group.

Returns
If the event group was created then a handle to the event group is returned. If there was insufficient FreeRTOS heap available to create the event group then NULL is returned. See http://www.freertos.org/a00111.html

Example usage:

   // Declare a variable to hold the created event group.
   EventGroupHandle_t xCreatedEventGroup;
   // Attempt to create the event group.
   xCreatedEventGroup = xEventGroupCreate();
   // Was the event group created successfully?
   if( xCreatedEventGroup == NULL )
   {
    // The event group was not created because there was insufficient
    // FreeRTOS heap available.
   }
   else
   {
    // The event group was created.
   }