TI中文支持网
TI专业的中文技术问题咨询交流网站

对Ti代码中有一个地方不太懂,求指教

RADARDEMO_clusterTracker_errorCode    RADARDEMO_clusterTracker_run(
                            IN  void * handle,
                            IN  RADARDEMO_tracker_input * input,
                            IN  float dt,
                            OUT RADARDEMO_tracker_output * output)

{
    uint32_t index;
    uint16_t nTrack, i;//定义变量
    RADARDEMO_clusterTracker_handle *clusterTrackerInst;
    RADARDEMO_clusterTracker_errorCode errorCode = RADARDEMO_CLUSTERTRACKER_NO_ERROR;

上面这里是进行函数定义吗???

其中RADARDEMO_clusterTracker_errorCode是枚举类型,其定义如下

typedef enum
{
    RADARDEMO_CLUSTERTRACKER_NO_ERROR = 0,                   /**< no error 没有错误*/
    RADARDEMO_CLUSTERTRACKER_FAIL_ALLOCATE_HANDLE,           /**< RADARDEMO_clusterTracker_create failed to allocate handle 无法分配句柄*/
    RADARDEMO_CLUSTERTRACKER_FAIL_ALLOCATE_LOCALINSTMEM,     /**< RADARDEMO_clusterTracker_create failed to allocate memory for buffers in local instance  RADARDEMO_clusterTracker_create无法为本地实例中的缓冲区分配内存*/    RADARDEMO_CLUSTERTRACKER_FAIL_ALLOCATE_TRACKER,          /**< RADARDEMO_clusterTracker_run failed to allocate new trackers  RADARDEMO_clusterTracker_run无法分配新的跟踪器*/
    RADARDEMO_CLUSTERTRACKER_INOUTPTR_NOTCORRECT,            /**< input and/or output buffer for RADARDEMO_clusterTracker_run are either NULL, or not aligned properly  RADARDEMO_clusterTracker_run的输入和/或输出缓冲区为NULL或未正确对齐*/
    RADARDEMO_CLUSTERTRACKER_NUM_TRACKER_EXCEED_MAX,         /**< the number of tracker exceed the max value  追踪器数量超过最大值*/
    RADARDEMO_CLUSTERTRACKER_NUM_ASSOC_EXCEED_MAX,           /**< the number of measure association exceed the max value  度量关联数超过最大值*/
    RADARDEMO_CLUSTERTRACKER_INPUT_EXCEED_MAX                /**< the number of input exceed the max value  输入数量超过最大值*/
} RADARDEMO_clusterTracker_errorCode;

xyz549040622:

对的,第一个是个函数,有四个参数,返回一个错误类型。

user6231379:

回复 xyz549040622:

在C语言中可用枚举类型去定义一个函数?一般函数定义不都是返回类型加函数名加参数表吗??

xyz549040622:

回复 user6231379:

这里枚举类型就是返回类型呀。

赞(0)
未经允许不得转载:TI中文支持网 » 对Ti代码中有一个地方不太懂,求指教
分享到: 更多 (0)