在STM32上用Keil MDK编译,遇到一个奇怪问题,该函数的形参pos为double,实参为30000.0,传递给pos,并将pos赋值给全局doulbe变量gPosition,用Jlink单步,将pos和gPosition加入观察窗口,但是结果pos显示为0,gPosition显示为30000,这是神马情况?
部分代码如下:
void sendAxisPulse(PAxis pAxis, double pos, unsigned int AxisStateDI_Addr )
{
int state;
double dPulseNum;
setAxisPositionState( pAxis, AxisStateDI_Addr );
state = pAxis->iState;
gPositon = pos;
} |