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.

sprintf的问题

用的CCSv5

调试的时候遇到一个问题——sprintf要么不支持float,要么不支持int,情况如下:

void Dogs102x6_FloatDraw(uint8_t row, uint8_t col, float temp, uint8_t style)
{
char buffer[50];

sprintf(buffer,"%-10.3f",temp);//在level of printf support 中选择Full时可用
Dogs102x6_stringDraw(row, col, buffer, style);
}

void Dogs102x6_IntDraw(uint8_t row, uint8_t col, uint16_t temp, uint8_t style)
{
char buffer[50];
sprintf(buffer, "%d", temp);//在level of printf support 中选择minimal时可用
Dogs102x6_stringDraw(row, col, buffer, style);
}