/* * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... *//* * This file contains the implementation for some the functions in * idf_additions.h * * event group functions are split into a separate file due to the dependency chain * xEventGroupCreateWithCaps->xEventGroupCreateStatic->event_groups.c->xTimerPendFunctionCallFromISR->timers.c * * In some cases this results in the weak timer task function getting overridden and * used even if the event group functions were discarded due to not being used. * * Putting the event groups function in a separate file avoids this issue unless the users himself calls * event group functions *//* ... */#include"sdkconfig.h"#include"freertos/FreeRTOS.h"#include"freertos/event_groups.h"#include"freertos/idf_additions.h"#include"esp_heap_caps.h"5 includes/* ------------------------------ Event Groups ------------------------------ */#if(configSUPPORT_STATIC_ALLOCATION==1)EventGroupHandle_txEventGroupCreateWithCaps(UBaseType_tuxMemoryCaps){EventGroupHandle_txEventGroup;StaticEventGroup_t*pxEventGroupBuffer;/* Allocate memory for the event group using the provided memory caps */pxEventGroupBuffer=heap_caps_malloc(sizeof(StaticEventGroup_t),uxMemoryCaps);if(pxEventGroupBuffer==NULL){returnNULL;}{...}/* Create the event group using static creation API */xEventGroup=xEventGroupCreateStatic(pxEventGroupBuffer);if(xEventGroup==NULL){heap_caps_free(pxEventGroupBuffer);}{...}returnxEventGroup;}{ ... }/* ... */#endif/* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) *//*----------------------------------------------------------*/#if(configSUPPORT_STATIC_ALLOCATION==1)voidvEventGroupDeleteWithCaps(EventGroupHandle_txEventGroup){// Return value unused if asserts are disabledBaseType_t__attribute__((unused))xResult;StaticEventGroup_t*pxEventGroupBuffer;/* Retrieve the buffer used to create the event group before deleting it * *//* ... */xResult=xEventGroupGetStaticBuffer(xEventGroup,&pxEventGroupBuffer);configASSERT(xResult==pdTRUE);/* Delete the event group */vEventGroupDelete(xEventGroup);/* Free the memory buffer */heap_caps_free(pxEventGroupBuffer);}{ ... }/* ... */#endif/* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) */------------------------------ Event Groups/*----------------------------------------------------------*/
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.