keil µVision5 IDE(MDK-Arm)
ARM Compiler V6.19
#include <stdio.h>
__ASM (".global __use_no_semihosting");
__ASM (".global __ARM_use_no_argv \n\t");
FILE __stdout;
int _ttywrch(int ch)
{
ch = ch;
return ch;
}
void _sys_exit(int x)
{
x = x;
}
char *_sys_command_string(char *cmd, int len)
{
return NULL;
}
//重定义fputc函数
int fputc(int ch, FILE *f)
{
while((USART1->SR&0X40)==0);//循环发送,直到发送完毕
USART1->DR = (uint8_t)ch;
return ch;
}
评论区