- 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 ;
- }
上面的那个send_char函数是2440的串口非中断发送函数!不要忘了加#include<stdio.h>哟
现在来看一看!
看到没有!呵呵 成功了
最后附上工程!
有任何疑问QQ905377346