完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
是用putchar()重定向还是用fputc()?
fputc() 1. keil MDK已经为我们提供了这样的接口文件: 文件位置:C:\Keil\ARM\Startup,(C:\Keil\为我的keil安装根目录) 文件名:Retarget.c /******************************************************************************/ /* RETARGET.C: 'Retarget' layer for target-dependent low level functions */ /******************************************************************************/ /* This file is part of the uVision/ARM development tools. */ /* Copyright (c) 2005 Keil Software. All rights reserved. */ /* This software may only be used under the terms of a valid, current, */ /* end user licence from KEIL for a compatible version of KEIL software */ /* development tools. Nothing else gives you the right to use this software. */ /******************************************************************************/ #include #include #include #pragma import(__use_no_semihosting_swi) extern int sendchar(int ch); /* in Serial.c */ extern int getkey(void); /* in Serial.c */ extern long timeval; /* in Time.c */ struct __FILE { int handle; /* Add whatever you need here */ }; FILE __stdout; FILE __stdin; int fputc(int ch, FILE *f) { return (sendchar(ch)); } int fgetc(FILE *f) { return (sendchar(getkey())); } int ferror(FILE *f) { /* Your implementation of ferror */ return EOF; } void _ttywrch(int ch) { sendchar (ch); } void _sys_exit(int return_code) { while (1); /* endless loop */ } |
|
相关推荐
1个回答
|
|
|
the Keil development tools. It may only be used in accordance*wit*h the terms of that license agreement (License.pdf). //******************************************************************************/#include
|
|
|
|
|
只有小组成员才能发言,加入小组>>
1053 浏览 1 评论
1874 浏览 0 评论
1853 浏览 1 评论
3277 浏览 5 评论
3606 浏览 9 评论
1055浏览 1评论
1876浏览 1评论
如何知道嵌入式电子控制单元 (ECU) 中的RAM使用情况?
1384浏览 1评论
1874浏览 0评论
1199浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-8 16:38 , Processed in 0.581557 second(s), Total 45, Slave 35 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
5856