请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
部件号:TMS320F28379D 尊敬的 TI:
我正在使用 CLA 执行此静态内联函数:
static inline void RST_Regulor(float R_Input, float S_Input, float T_Input,
uint16_t RST_Enable, float oldActu, float *Output)
{
uint16_t i;
/*******************************************
* Compute T polynome *
*******************************************/
/* Shift the delay line to the right by 1 */
for(i = SIZE_OF_T-1; i > 0; i--)
{
/* Shift */
Poly_T[i] = Poly_T[i-1];
/* Multiplication and Addition*/
T += coef_t[i] * Poly_T[i];
}
/* Get adc physical input into start of the delay line */
/* note the adc input is simulated in software */
if (RST_Enable == 1u)
{
Poly_T[0] = T_Input; //reference
}
else
{
Poly_T[0] = R_Input; //measured
}
/*Add the first param */
T += coef_t[0] * Poly_T[0];
/*******************************************
* Compute R polynome *
*******************************************/
/* Shift the delay line to the right by 1 */
#pragma UNROLL(SIZE_OF_R-1)
for(i = SIZE_OF_R-1; i > 0; i--)
{
/* Shift */
Poly_R[i] = Poly_R[i-1];
/*Multiplication and Addition*/
R += coef_r[i] * Poly_R[i];
}
/* Get adc physical input into start of the delay line */
/* note the adc input is simulated in software */
Poly_R[0] = R_Input;
R += coef_r[0] * Poly_R[0];
/*******************************************
* Compute S polynome *
*******************************************/
//Shift the delay line to the right by 1
#pragma UNROLL(SIZE_OF_S-1)
for(i = SIZE_OF_S-1; i > 0; i--)
{
/* Shift */
Poly_S[i] = Poly_S[i-1];
/* Multiplication and Addition*/
S += coef_s[i] * Poly_S[i];
}
/* Get adc physical input into start of the delay line */
/* note the adc input is simulated in software */
Poly_S[0] = oldActu;
S += coef_s[0] * Poly_S[0];
/**** Result*****/
if(RST_Enable == 1u)
{
/* Regulation output if enable*/
*Output = (T - R - S) * INVERS_S0;
}
else
{
/* Old value if RST regulation is not enabled */
*Output = oldActu;
}
}
CLA 任务中的呼叫功能如下:
/* RST regulation */
RST_Regulor(IDC_CLA, //R
CLA_StaActu, //S
Ref_CLA, //T
Enable_CLA, //Enable
CLA_StaActu, //Old actuation
&DutyCycleMan); //RST output regulation
监视表达式如下:

问题是,即使使用相同的代码来移动 Pol_S,某些向量也不会移动?
Poly_R 缓冲区不应为空,因为 R_Input 是 IDC_CLA 10.11,我们在 watch 表达式中看到,Enable_CLA 是1?
#pragma UNROLL(SIZE_OF_R-1)
for(i = SIZE_OF_R-1; i > 0; i--)
{
/* Shift */
Poly_R[i] = Poly_R[i-1];
/*Multiplication and Addition*/
R += coef_r[i] * Poly_R[i];
}
/* Get adc physical input into start of the delay line */
/* note the adc input is simulated in software */
Poly_R[0] = R_Input;
R += coef_r[0] * Poly_R[0];
这项功能似乎没有得到遵守或正确执行吗?
你有什么想法吗?
提前感谢您,
S.Tarik