static inline void CLARKE_run(CLARKE_Handle handle,const MATH_vec3 *pInVec,MATH_vec2 *pOutVec)
{
CLARKE_Obj *obj = (CLARKE_Obj *)handle;
uint_least8_t numSensors = obj->numSensors;
_iq alpha_sf = obj->alpha_sf;
_iq beta_sf = obj->beta_sf;
if(numSensors == 3)
{
pOutVec->value[0] = _IQmpy(lshft_1(pInVec->value[0]) – (pInVec->value[1] + pInVec->value[2]),alpha_sf);
pOutVec->value[1] = _IQmpy(pInVec->value[1] – pInVec->value[2],beta_sf);
}
else if(numSensors == 2)
{
pOutVec->value[0] = _IQmpy(pInVec->value[0],alpha_sf);
pOutVec->value[1] = _IQmpy(pInVec->value[0] + lshft_1(pInVec->value[1]),beta_sf);
}
return;
} // end of CLARKE_run() function
我怎样 才能 查到 obj->beta_sf;在什么地方赋值的?
Martin Yu:
直接找调用CLARK_run()函数是传递的CLARKE类型指针所指向的的结构体就可以了。
这个程序是Motorware里面的吗?
static inline void CLARKE_run(CLARKE_Handle handle,const MATH_vec3 *pInVec,MATH_vec2 *pOutVec)
{
CLARKE_Obj *obj = (CLARKE_Obj *)handle;
uint_least8_t numSensors = obj->numSensors;
_iq alpha_sf = obj->alpha_sf;
_iq beta_sf = obj->beta_sf;
if(numSensors == 3)
{
pOutVec->value[0] = _IQmpy(lshft_1(pInVec->value[0]) – (pInVec->value[1] + pInVec->value[2]),alpha_sf);
pOutVec->value[1] = _IQmpy(pInVec->value[1] – pInVec->value[2],beta_sf);
}
else if(numSensors == 2)
{
pOutVec->value[0] = _IQmpy(pInVec->value[0],alpha_sf);
pOutVec->value[1] = _IQmpy(pInVec->value[0] + lshft_1(pInVec->value[1]),beta_sf);
}
return;
} // end of CLARKE_run() function
我怎样 才能 查到 obj->beta_sf;在什么地方赋值的?
user1303469:
回复 Martin Yu:
是的,谢谢老师指导!