FatFs R0.14a, released December 5, 2020

This commit is contained in:
Christopher Williams
2021-01-14 18:05:43 -07:00
parent cf1fa00811
commit 8aa4448e7e
36 changed files with 524 additions and 410 deletions
+6 -5
View File
@@ -39,7 +39,7 @@ int f_printf (
<div class="para ret">
<h4>Return Values</h4>
<p>When the string was written successfuly, it returns number of character encoding units written to the file. When the function failed due to disk full or any error, an <tt>EOF (-1)</tt> will be returned.</p>
<p>When the string was written successfuly, it returns number of character encoding units written to the file. When the function failed due to disk full or any error, a negative value will be returned.</p>
</div>
@@ -47,12 +47,13 @@ int f_printf (
<h4>Description</h4>
<p>The format control directive is a sub-set of standard library shown as follows:</p>
<pre>
%[flag][width][type]
%[flag][width][prefix][type]
</pre>
<dl>
<dt>flag</dt><dd>Padding options. A <tt>-</tt> specifies left justified. A <tt>0</tt> specifies zero padded.</dd>
<dt>width</dt><dd>Minimum width of the field, <tt>1-99</tt> or <tt>*</tt>. If the width of generated string is less than the specified value, rest field is padded with white spaces or zeros. An <tt>*</tt> specifies the value comes from an argument in int type.</dd>
<dt>type</dt><dd><tt>c s d u o x b</tt> and prefix <tt>l</tt> specify type of the argument, character, string, signed integer in decimal, unsigned integer in decimal, unsigned integer in octal, unsigned integer in hexdecimal and unsigned integer in binary respectively. If <tt>sizeof (long)</tt> is greater than <tt>sizeof (int)</tt> (this is typical of 8/16-bit systems), a prefix <tt>l</tt> needs to be explicitly specified for long integer argument. These characters except for <tt>x</tt> are case insensitive.</dd>
<dt>flag</dt><dd>Padding options. A <tt>'0'</tt> specifies zero padded. A <tt>'-'</tt> specifies left justified.</dd>
<dt>width</dt><dd>Minimum width of the field, <tt>'1'-'99'</tt> or <tt>'*'</tt>. If the width of generated string is less than the specified value, rest field is padded with white spaces or zeros. An <tt>*</tt> specifies the value comes from an argument in int type. The default value is zero.</dd>
<dt>prefix</dt><dd>Size prefix <tt>'l'</tt> for long integer argument. If <tt>sizeof (long) == sizeof (int)</tt> (this is typical of 32-bit systems), the size prefix can be omitted.</dd>
<dt>type</dt><dd><tt>'c','s','d','u','o','x','b'</tt>, specify type of the argument and output format, character, string, signed integer in decimal, unsigned integer in decimal, unsigned integer in octal, unsigned integer in hexdecimal and unsigned integer in binary respectively. These characters except <tt>'x'</tt> are case insensitive. An <tt>'X'</tt> generates a hexdecimal in up-case.</dd>
</dl>
<p>When FatFs is configured for Unicode API (<tt><a href="config.html#lfn_unicode">FF_LFN_UNICODE</a> &gt;= 1</tt>), character encoding on the string fuctions, <tt>f_putc</tt>, <tt>f_puts</tt>, <tt>f_printf</tt> and <tt>f_gets</tt> function, is also switched to Unicode. The Unicode characters in multiple encoding unit, such as surrogate pair and multi-byte sequence, should not be divided into two function calls, or the character will be lost. The character encoding <em>on the file</em> to be written via this function is selected by <tt><a href="config.html#strf_encode">FF_STRF_ENCODE</a></tt>. The characters with wrong encoding or invalid for the output encoding will be lost.</p>
</div>