请教!
main中有stdio.h
勾选了micro LIB
如下代码是借用STM32的,怎么改使用于KEA?
struct __FILE
{
int handle;
/* Whatever you require here. If the only file you are using is */
/* standard output using printf() for debugging, no file handling */
/* is required. */
};
/* FILE is typedef’ d in stdio.h. */
FILE __stdout;
FILE __stdin;
_sys_exit(int x)
{
x = x;
}
void send_char(char num)
{
rUTXH0 =num;
while((rUTRSTAT0 & 4 )==0);
}
int fputc(int ch,FILE *f)
{
send_char((char)ch);
return ch;
}
int fgetc(FILE *f)
{
while((rUTRSTAT0 &1)==0);
return rURXH0 ;
}
|