<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem in zero padding? in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-in-zero-padding/m-p/1210608#M43551</link>
    <description>&lt;P&gt;Hello Diego,&lt;/P&gt;&lt;P&gt;That is true the row above in the table states that a 0 prefix replaces space with zero padding and the format give was "%02X", as would be the case with standard C printf formatting.&lt;/P&gt;&lt;P&gt;Might this be a size optimization option to trimming down the set of formatting variants supported?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/180501"&gt;@mohd_&lt;/a&gt;: Have you considered rolling your own simple zero-extended tracing function as a workaround? Below is one such straightforward and entirely untested implementation&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void PrintZeroExtended(uint32_t value, uint32_t radix, int32_t width) {
  char buffer[sizeof "01234567"];
  char *textptr = &amp;amp;buffer[sizeof buffer];
  *--textptr = '\0';
  do {
    *--textptr = "0123456789ABCDEF"[value % radix];
    value /= radix;
  } while(--width &amp;gt;= 0 || value);
  PRINTF("%s", textptr);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Johan&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jan 2021 20:50:33 GMT</pubDate>
    <dc:creator>jforslof</dc:creator>
    <dc:date>2021-01-12T20:50:33Z</dc:date>
    <item>
      <title>Problem in zero padding?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-in-zero-padding/m-p/1208899#M43497</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have problem with zero padding.&lt;/P&gt;&lt;P&gt;Here is my example code. I am using MCUXpresso IDE.&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("0x%04X&amp;nbsp; ",&amp;nbsp; buf);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The result is in the picture attached.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Syamil&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="キャプチャ3.PNG" style="width: 659px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134328i053D71F169CA84B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="キャプチャ3.PNG" alt="キャプチャ3.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 10:34:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-in-zero-padding/m-p/1208899#M43497</guid>
      <dc:creator>mohd_</dc:creator>
      <dc:date>2021-01-08T10:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in zero padding?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-in-zero-padding/m-p/1210595#M43550</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/180501"&gt;@mohd_&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, this is the behaviour of the PRINTF function.&lt;/P&gt;
&lt;P&gt;if the number for the left padding is greather than the number to be printed, the PRINTF function will pad blank spaces.&lt;/P&gt;
&lt;P&gt;Please, take a look at the below snapshot:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="padding.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134599iDBFCF0AFC3B2289F/image-size/large?v=v2&amp;amp;px=999" role="button" title="padding.png" alt="padding.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://mcuxpresso.nxp.com/api_doc/dev/116/group__debugconsole.html" target="_blank"&gt;https://mcuxpresso.nxp.com/api_doc/dev/116/group__debugconsole.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I hope this could help you!&lt;/P&gt;
&lt;P&gt;If you have any comment of further question, let me know!&lt;/P&gt;
&lt;P&gt;All the best,&lt;/P&gt;
&lt;P&gt;Diego&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 20:06:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-in-zero-padding/m-p/1210595#M43550</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2021-01-12T20:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in zero padding?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-in-zero-padding/m-p/1210608#M43551</link>
      <description>&lt;P&gt;Hello Diego,&lt;/P&gt;&lt;P&gt;That is true the row above in the table states that a 0 prefix replaces space with zero padding and the format give was "%02X", as would be the case with standard C printf formatting.&lt;/P&gt;&lt;P&gt;Might this be a size optimization option to trimming down the set of formatting variants supported?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/180501"&gt;@mohd_&lt;/a&gt;: Have you considered rolling your own simple zero-extended tracing function as a workaround? Below is one such straightforward and entirely untested implementation&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void PrintZeroExtended(uint32_t value, uint32_t radix, int32_t width) {
  char buffer[sizeof "01234567"];
  char *textptr = &amp;amp;buffer[sizeof buffer];
  *--textptr = '\0';
  do {
    *--textptr = "0123456789ABCDEF"[value % radix];
    value /= radix;
  } while(--width &amp;gt;= 0 || value);
  PRINTF("%s", textptr);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Johan&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2021 20:50:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-in-zero-padding/m-p/1210608#M43551</guid>
      <dc:creator>jforslof</dc:creator>
      <dc:date>2021-01-12T20:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in zero padding?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-in-zero-padding/m-p/1210654#M43554</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/89833"&gt;@diego_charles&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Thank you for the information!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 00:47:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-in-zero-padding/m-p/1210654#M43554</guid>
      <dc:creator>mohd_</dc:creator>
      <dc:date>2021-01-13T00:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem in zero padding?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-in-zero-padding/m-p/1210659#M43555</link>
      <description>&lt;P&gt;Hi Johan&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/181828"&gt;@jforslof&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Thank you for your suggestion!&lt;/P&gt;&lt;P&gt;Your code works well!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Syamil&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="キャプチャ4.PNG" style="width: 659px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/134607i8C6B3B949DE185D1/image-size/large?v=v2&amp;amp;px=999" role="button" title="キャプチャ4.PNG" alt="キャプチャ4.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 00:51:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-in-zero-padding/m-p/1210659#M43555</guid>
      <dc:creator>mohd_</dc:creator>
      <dc:date>2021-01-13T00:51:40Z</dc:date>
    </item>
  </channel>
</rss>

