新手入门
- 积分
- 7
- 金钱
- 7
- 注册时间
- 2016-8-18
- 在线时间
- 0 小时
|
发表于 2016-8-18 22:24:56
|
显示全部楼层
hi,你问题解决了吗,没有的话试试我的方法?然后target里把微库勾上[mw_shl_code=cpp,true]extern "C" {
//////////////////////////////////////////////////////////////////
//¼óèëòÔÏÂ′úÂë,Ö§3Öprintfoˉêy,¶ø2»DèòaÑ¡Ôñuse MicroLIB
#if 1
#pragma import(__use_no_semihosting)
//±ê×¼¿aDèòaμÄÖ§3Öoˉêy
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;
//¶¨òå_sys_exit()òÔ±üÃaê1óðëÖ÷»úÄ£ê½
void _sys_exit(int x)
{
x = x;
}
//Öض¨òåfputcoˉêy
int fputc(int ch, FILE *f)
{
while((USART1->SR&0X40)==0);//Ñ-»··¢Ëí,Ö±μ½·¢Ëííê±Ï
USART1->DR = (u8) ch;
return ch;
}
#endif
//end
//////////////////////////////////////////////////////////////////
}[/mw_shl_code] |
|