/*
#pragma import(__use_no_semihosting) //#pragma编译指示的预处理指令,一般格式为:
#pragma para //pragma为预编译指令的编译指示,para为参数
依据参数分类执行,限于通知编译器可以做的行为,此指令专用于机器或操作系统。import(__use_no_semihosting) 即为参数,import为导入类,()括号内的字符为导入的字符,通知编译器不要从C库链接时使用带有半主机semihosting的函数
*/
#pragma import(__use_no_semihosting) //微库不用勾选上(microLIB)
//需要标准库支持函数
struct __FILE
{
int handle;
};
FILE __stdout;
//定义 _sys_exit() 以避免使用半主机模式
_sys_exit(int x)
{
x = x;
}
//重定义fputc函数
int fputc(int ch, FILE *f)
{
while((USART1->SR&0X40)==0);
USART1->DR = (u8) ch;
return ch;
}