<?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>Kinetis Software Development Kit中的主题 Re: debug_scanf() not working?</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/debug-scanf-not-working/m-p/382212#M1012</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That´s ok :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Iva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Mar 2015 09:40:37 GMT</pubDate>
    <dc:creator>ivadorazinova</dc:creator>
    <dc:date>2015-03-16T09:40:37Z</dc:date>
    <item>
      <title>debug_scanf() not working?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/debug-scanf-not-working/m-p/382209#M1009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;in a project, created with KDS 2.0.0, KSDK 1.1.0 and PE, I'm trying to create some user interaction with the console.&lt;/P&gt;&lt;P&gt;I added the fsl_debug_console component in PE.&lt;/P&gt;&lt;P&gt;I can output messages using debug_printf() and read 1 character using debug_getchar().&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now in fsl_debug_console.c there is the debug_scanf() funtion, that I expect to work like the classic scanf().&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it seems that it doesn't:&lt;/P&gt;&lt;PRE class="c++" name="code"&gt; uint16_t choice;&amp;nbsp; debug_printf("\nSet Year (last 2 digit): ");&amp;nbsp; choice = debug_scanf("%d",&amp;amp;choice);&amp;nbsp; debug_printf("%d\n",choice);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The input is "15\n", so I expect that the debug_printf() outputs "15\n", but the output is "1\n".&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I doing something wrong?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, regards Giacomo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 15:24:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/debug-scanf-not-working/m-p/382209#M1009</guid>
      <dc:creator>giacomopetrini</dc:creator>
      <dc:date>2015-03-12T15:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: debug_scanf() not working?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/debug-scanf-not-working/m-p/382210#M1010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;STRONG class="font-color-meta"&gt;&lt;SPAN class="replyToName"&gt;giacomopetrini&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN class="replyToName"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="replyToName"&gt;the bad thing is, that you assign debug_scanf(&lt;SPAN class="string"&gt;"%d",&amp;amp;choice) to choice.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You must do it by this way:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="replyToName"&gt;&lt;SPAN class="string"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; uint16_t choice;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; debug_printf("\nSet Year (last 2 digit): ");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; debug_scanf("%d",&amp;amp;choice);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; debug_printf("%d\n",choice);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Iva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Mar 2015 21:28:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/debug-scanf-not-working/m-p/382210#M1010</guid>
      <dc:creator>ivadorazinova</dc:creator>
      <dc:date>2015-03-15T21:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: debug_scanf() not working?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/debug-scanf-not-working/m-p/382211#M1011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;I'm an idiot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Best Regards Giacomo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2015 09:39:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/debug-scanf-not-working/m-p/382211#M1011</guid>
      <dc:creator>giacomopetrini</dc:creator>
      <dc:date>2015-03-16T09:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: debug_scanf() not working?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/debug-scanf-not-working/m-p/382212#M1012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That´s ok :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Iva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2015 09:40:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/debug-scanf-not-working/m-p/382212#M1012</guid>
      <dc:creator>ivadorazinova</dc:creator>
      <dc:date>2015-03-16T09:40:37Z</dc:date>
    </item>
  </channel>
</rss>

