STM32添加printf支持
来源:互联网 发布:淘宝直通车在哪开通 编辑:程序博客网 时间:2024/05/20 09:24
在软件高度过程中,使用printf打印输出信息非常方便,可通过添加以下内容实现STM32对printf的支持。
- #include <stdio.h>
- #ifdef __GNUC__
- #define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
- #else
- #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
- #endif
- /**
- * @brief Retargets the C library printf function 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(USART1, (uint8_t) ch);
- /* Loop until the end of transmission */
- while(USART_GetFlagStatus(USART1, USART_FLAG_TC) == RESET)
- {
- }
- return ch;
- }
http://blog.csdn.net/dldw8816/article/details/44563749
阅读全文
0 0
- STM32添加printf支持
- 让MDK支持printf(基于stm32)
- 让MDK支持printf(基于stm32)
- 让MDK支持printf(基于stm32)
- 在STM32中添加printf、scanf函数
- 添加printf
- STM32 下使用printf
- STM32 printf重定向
- STM32 printf问题
- stm32 printf 重定义
- STM32 printf函数重写
- STM32中printf函数
- STM32 printf重定向
- STM32 printf重定向
- STM32使用printf
- STM32串口打印printf
- stm32 printf 死机
- stm32 printf重定向
- 蓝桥杯_ 入门训练 Fibonacci数列
- StringRedisTemplate常用操作
- 常用win+r
- Cashier Employment
- 【备忘】最新尚学堂redis视频教程下载
- STM32添加printf支持
- python包seaborn安装与入门
- InnoDB与MyISAM数据引擎对比选择
- 2017年科技界十大新闻,你都知道吗?
- 73. Set Matrix Zeroes
- ASP.NET请求处理过程
- 解决svn: Can't convert string from 'UTF-8' to native encoding问题
- Drainage Ditches
- Android 8.0系统源码分析--Message发送、处理过程源码分析