#include <stdio.h>
int fputc(int ch, FILE *f)//STM8S105,printf函数重定向
{
while (!(UART2->SR&0x80));
UART2->DR=ch;
return ch;
}
同时需要修改IAR的Projec t- >Options -> General Options -> Library Configuration中的Library 项由"Normal"改为"Full"。
int fputc(int ch, FILE *f)//STM8S105,printf函数重定向
{
while (!(UART2->SR&0x80));
UART2->DR=ch;
return ch;
}
同时需要修改IAR的Projec t- >Options -> General Options -> Library Configuration中的Library 项由"Normal"改为"Full"。