A simple UART based printf function supporting %c, %d, %p, %s, %u, %x, and %X.
Parameters
pcString
is 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.上面说的这个函数不是不能打印浮点型得嘛