串口打印 - TMS320C6748 - 嵌入式开发者社区 - 51ele.net
设为首页收藏本站

嵌入式开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 4486|回复: 3
打印 上一主题 下一主题

[未解决] 串口打印

[复制链接]

1

主题

5

帖子

1034

积分

金牌会员

Rank: 6Rank: 6

积分
1034
楼主
发表于 2019-5-5 22:33:28 | 显示全部楼层
void UARTprintf (const char * pcString,
...
)

A simple UART based printf function supporting %c, %d, %p, %s, %u, %x, and %X.
Parameters
pcStringis the format string.
...are the optional arguments, which depend on the contents of the format string.
This function is very similar to the C library fprintf() function. All of its output will be sent to the UART. Only the following formatting characters are supported:
  • %c to print a character
  • %d to print a decimal value
  • %s to print a string
  • %u to print an unsigned decimal value
  • %x to print a hexadecimal value using lower case letters
  • %X to print a hexadecimal value using lower case letters (not upper case letters as would typically be used)
  • %p to print a pointer as a hexadecimal value
  • %% to print out a % character
For %s, %d, %u, %p, %x, and %X, an optional number may reside between the % and the format character, which specifies the minimum number of characters to use for that value; if preceded by a 0 then the extra characters will be filled with zeros instead of spaces. For example, \%8d'' will use eight characters to print the decimal value with spaces added to reach eight;%08d'' will use eight characters as well but will add zeroes instead of spaces.
The type of the arguments after pcString must match the requirements of the format string. For example, if an integer was passed where a string was expected, an error of some kind will most likely occur.
ReturnsNone.上面说的这个函数不是不能打印浮点型得嘛


回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|嵌入式开发者社区 ( 粤ICP备15055271号

GMT+8, 2024-5-4 20:35 , Processed in 0.034649 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2015 Comsenz Inc.

快速回复 返回顶部 返回列表