This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CCS/EK-TM4C129EXL:无法打印浮动值

Guru**** 2460850 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/649462/ccs-ek-tm4c129exl-unable-to-print-floating-values

器件型号:EK-TM4C129EXL

工具/软件:Code Composer Studio

大家好、我正在进行 CAN 总线项目、执行2个无符号16位数之间的除法运算后、似乎无法打印浮点值。 该值打印为"ERROR2f":

仅为打印部分附加了代码片段:

uint8_t PPGMsg[5];
float PPG;
uint16_t IR_组合型、red_组合型;
for (uIdx = 0;uIdx < psCANMsg->ui32MsgLen; uIdx++)
{
PPGMsg[uIdx]=psCANMsg->pui8MsgData[uIdx];
}
IR_Combined =(PPGMsg[1]<<8)|PPGMsg[2];
RED_FLOC=(PPGMsg[3]<<8)|PPGMsg[0]|PPG=(组合型




);"PPG_0=red_float_0[i20=(_float)+[g=(uId=uId=uId=(uId)+)|PPG=(uId=(uId=(uG)+)+=(uG)+=(uG)+=(uG)+)+=(uG=(uG)=(uG)=(uPM=(uPM=(u

UARTprintf ("red_bined 为:%d\n"、red_bined);
UARTprintf ("PPG 为:%d\n"、PPGMsg[0]);
UARTprintf ("float PPG 1为:%.2f\n"、PPG);
UARTprintf ("done");