ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Пятница
29 марта
730528 Топик полностью
бомж (24.01.2017 11:49 - 12:24, просмотров: 317) ответил Bill на А ка вы эту самую malloc используете?
Вот так  int32_t lTkRet = CIFX_NO_ERROR; /* First of all initialize toolkit */ lTkRet = cifXTKitInit(); if(CIFX_NO_ERROR == lTkRet) { #if 1 /* так не работает */ PDEVICEINSTANCE ptDevInstance = (PDEVICEINSTANCE)malloc(sizeof(*ptDevInstance)); #else /* а вот так работает */ DEVICEINSTANCE DevInstance; PDEVICEINSTANCE ptDevInstance = &DevInstance; #endif if(NULL != ptDevInstance) { OS_Memset(ptDevInstance, 0, sizeof(*ptDevInstance)); /* Set trace level of toolkit */ g_ulTraceLevel = TRACE_LEVEL_ERROR | TRACE_LEVEL_WARNING | TRACE_LEVEL_INFO | TRACE_LEVEL_DEBUG; /* Insert the basic device information , into the DeviceInstance structure for the toolkit. The DPM address must be zero, as we only transfer address offsets via the SPI interface. NOTE: The physical address and irq number are for information use only, so we skip them here. Interrupt is currently not supported and ignored, so we dont need to set it */ ptDevInstance->fPCICard = 0; ptDevInstance->pvOSDependent = ptDevInstance; ptDevInstance->ulDPMSize = 0x10000; OS_Strncpy(ptDevInstance->szName, "cifX0", sizeof(ptDevInstance->szName)); SerialDPM_Init(ptDevInstance); /* Add the device to the toolkits handled device list */ lTkRet = cifXTKitAddDevice(ptDevInstance); /* If it succeeded do device tests */ if(CIFX_NO_ERROR != lTkRet) { /* Uninitialize Toolkit, this will remove all handled boards from the toolkit and deallocate the device instance */ cifXTKitDeinit(); } else { EnumBoardDemo(); //SysdeviceDemo(); //ChannelDemo(); //BlockDemo(); //PerformanceDemo(100); //IOMirrorDemo(); } } }
memento mori