FreeRTOS_Support.c
void vRtosTaskDelete(TaskHandle_t xHandle) {
	if (xHandle == NULL) {
		xHandle = xTaskGetCurrentTaskHandle();
	}
	#if (configRUN_TIME_COUNTER_SIZE == 4)
	xRtosSemaphoreTake(&RtosStatsMux, portMAX_DELAY);
	// Clear dynamic runtime info
	for (int i = 0; i < CONFIG_ESP_COREDUMP_MAX_TASKS_NUM; ++i) {
		if (Handle[i] == xHandle) {
			Tasks[i].U64 = 0ULL;
			Handle[i] = NULL;
			break;
		}
	}
	// Clear "static" task info
	TaskStatus_t * psTS = psRtosStatsFindWithHandle(xHandle);
	if (psTS) {
		memset(psTS, 0, sizeof(TaskStatus_t));
	}
	xRtosSemaphoreGive(&RtosStatsMux);
	#endif
	IF_RP(debugTRACK && ioB1GET(ioUpDown), "[%s] deleting\n", pcTaskGetName(xHandle));
	vTaskDelete(xHandle);
}
/**
 * @brief	Clear task runtime and static statistics data then delete the task
 * @param	Handle of task to be terminated (NULL = calling task)
 */
@brief       Clear task runtime and static statistics data then delete the task
@param       Handle of task to be terminated (NULL = calling task)
@brief Clear task runtime and static statistics data then delete the task @param Handle of task to be terminated ( NULL = calling task )
void vRtosTaskDelete(TaskHandle_t xHandle) {
	if (xHandle == NULL) {
		xHandle = xTaskGetCurrentTaskHandle();
	}
	#if (configRUN_TIME_COUNTER_SIZE == 4)
	xRtosSemaphoreTake(&RtosStatsMux, portMAX_DELAY);
	for (int i = 0; i < CONFIG_ESP_COREDUMP_MAX_TASKS_NUM; ++i) {
		if (Handle[i] == xHandle) {
			Tasks[i].U64 = 0ULL;
			Handle[i] = NULL;
			break;
		}
	}
	TaskStatus_t * psTS = psRtosStatsFindWithHandle(xHandle);
	if (psTS) {
		memset(psTS, 0, sizeof(TaskStatus_t));
	}
	xRtosSemaphoreGive(&RtosStatsMux);
	#endif
	IF_RP(debugTRACK && ioB1GET(ioUpDown), "[%s] deleting\n", pcTaskGetName(xHandle));
	vTaskDelete(xHandle);
}
void vRtosTaskDelete ( TaskHandle_t xHandle ) { if ( xHandle == NULL ) { xHandle = xTaskGetCurrentTaskHandle ( ) ; } #if ( configRUN_TIME_COUNTER_SIZE == 4 ) xRtosSemaphoreTake ( & RtosStatsMux , portMAX_DELAY ) ; for ( int i = 0 ; i < CONFIG_ESP_COREDUMP_MAX_TASKS_NUM ; ++ i ) { if ( Handle [ i ] == xHandle ) { Tasks [ i ] . U64 = 0ULL ; Handle [ i ] = NULL ; break ; } } TaskStatus_t * psTS = psRtosStatsFindWithHandle ( xHandle ) ; if ( psTS ) { memset ( psTS , 0 , sizeof ( TaskStatus_t ) ) ; } xRtosSemaphoreGive ( & RtosStatsMux ) ; #endif IF_RP ( debugTRACK && ioB1GET ( ioUpDown ) , " \n " , pcTaskGetName ( xHandle ) ) ; vTaskDelete ( xHandle ) ; }
@brief       Clear task runtime and static statistics data then delete the task
 @param       Handle of task to be terminated (NULL = calling task)
@brief Clear task runtime and static statistics data then delete the task @param Handle of task to be terminated ( NULL = calling task )
// Clear dynamic runtime info // Clear "static" task info