编译环境:Atmel Studio 6.2
按下面方式虚拟串口
#ifdef __GNUC__
/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif /* __GNUC__ */
PUTCHAR_PROTOTYPE
{
/* Place your implementation of fputc here */
/* e.g. write a character to the USART */
Send_Data((uint8_t) ch);
/* Loop until the end of transmission */
return ch;
}
打印的时候,字母数字符号什么的都正常,但是输出浮点数结果全是 f(0x66),请问有哪位知道原因吗? |