IAR中通过串口使用printf函数
来源:互联网 发布:windows系统编程基础 编辑:程序博客网 时间:2024/05/29 19:16
1.关键之处,否则会出现PUTCHAR函数未定义现象。
右键点击工程选择option-> General Option->ibrary configuration中library改为full,且 General Option->library option->Printf formatter选项中选择full2
2. main.c中加入,其中使用的是串口1
/* ---------------------------Privatefunction prototypes -----------------------------------------------*/
#ifdef __GNUC__
/* With GCC/RAISONANCE, small printf(option LD Linker->Libraries->Small printf
set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int__io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch,FILE *f)
#endif /* __GNUC__ */
和
/**
*@brief Retargets the C library printffunction to the USART.
*@param None
*@retval None
*/
PUTCHAR_PROTOTYPE
{
/*Place your implementation of fputc here */
/*e.g. write a character to the USART */
USART_SendData(EVAL_COM1, (uint8_t) ch);
/*Loop until the end of transmission */
while (USART_GetFlagStatus(EVAL_COM1, USART_FLAG_TC) == RESET);
return ch;
}
printf函数打印字符串,遇到\0时才结束。
- IAR中通过串口使用printf函数
- IAR中使用printf总结
- IAR中printf的使用
- STM32在IAR和MDK中使用printf进行串口打印的实现方法
- iar中使用DMA+printf+uart1
- 通过串口实现printf和scanf函数
- 通过串口实现printf和scanf函数
- 嵌入式系统中如何使用printf函数进行串口输出
- 通过UART使用printf函数
- 基于STM32在IAR中调用printf()函数
- IAR +STM32实现printf()输出到串口
- keil C 中调用串口函数 printf
- STM32串口使用Printf()函数问题
- STM32串口使用Printf()函数问题
- IAR开发环境使用串口printf输出(基于STM8L15x系列单片机)
- 在MDK中使用printf及串口
- STM32中使用printf打印串口数据
- 怎样在TI stellaris lm3sxxx 程序中使用C语言printf()函数进行串口输出
- 在DHTML中响应ActiveX控件的事件
- OpenCV-2.2.0-win32-vs2010在VS2010下的安装
- 山师的同学们怎么没有在这个论坛的?
- 覆盖、重写与重载的理解
- 优化浏览器渲染
- IAR中通过串口使用printf函数
- hdu 3592 World Exhibition //差分约束
- Log4j使用详解
- sis191网卡在ubuntu中上网问题总结
- 阅读QNX《System Architecture》中
- 存储过程小知识1
- Ant 条件判断 condition
- 音频播放不能深度睡眠のAudioOutLock
- QNX Neutrino 虚拟机