<?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: GETCHAR() non blocking?</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/GETCHAR-non-blocking/m-p/753081#M7725</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GETCHAR() is blocking.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use a call that's non blocking so the main can do other things.&amp;nbsp; Since I am not running an RTOS, if I do a blocking call in main, nothing else will run in main unless I enter a char. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example of what I am looking for:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://cboard.cprogramming.com/c-programming/130243-non-blocking-getchar.html" title="https://cboard.cprogramming.com/c-programming/130243-non-blocking-getchar.html"&gt;C Board&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Dec 2017 13:01:00 GMT</pubDate>
    <dc:creator>dougbaker</dc:creator>
    <dc:date>2017-12-05T13:01:00Z</dc:date>
    <item>
      <title>GETCHAR() non blocking?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/GETCHAR-non-blocking/m-p/753079#M7723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a function that gets a char from the RS232 port like GETCHAR() that's non blocking?&amp;nbsp; I'm using a KL17 and SDK 2.0.&amp;nbsp; I would like to get char from the debug port if if there is one in the buffer but if there's not a char there I would like to not block and continue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Doug&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2017 20:58:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/GETCHAR-non-blocking/m-p/753079#M7723</guid>
      <dc:creator>dougbaker</dc:creator>
      <dc:date>2017-11-30T20:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: GETCHAR() non blocking?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/GETCHAR-non-blocking/m-p/753080#M7724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-userid="288994" data-username="dougbaker" href="https://community.nxp.com/people/dougbaker"&gt;Doug ：&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer to the GETCHAR usage from the hello world example,&lt;/P&gt;&lt;P&gt;SDK_2.0_MKL17Z256xxx4\boards\frdmkl43z\demo_apps\hello_world&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; char ch;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Init board hardware. */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BOARD_InitPins();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BOARD_BootClockRUN();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BOARD_InitDebugConsole();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("hello world.\r\n");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ch = GETCHAR();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PUTCHAR(ch);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please also check the Kinetis SDK API Reference Manual for more details.&lt;/P&gt;&lt;P&gt;Chater 32. Debug console&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Daniel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 06:53:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/GETCHAR-non-blocking/m-p/753080#M7724</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2017-12-05T06:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: GETCHAR() non blocking?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/GETCHAR-non-blocking/m-p/753081#M7725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GETCHAR() is blocking.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to use a call that's non blocking so the main can do other things.&amp;nbsp; Since I am not running an RTOS, if I do a blocking call in main, nothing else will run in main unless I enter a char. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example of what I am looking for:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://cboard.cprogramming.com/c-programming/130243-non-blocking-getchar.html" title="https://cboard.cprogramming.com/c-programming/130243-non-blocking-getchar.html"&gt;C Board&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2017 13:01:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/GETCHAR-non-blocking/m-p/753081#M7725</guid>
      <dc:creator>dougbaker</dc:creator>
      <dc:date>2017-12-05T13:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: GETCHAR() non blocking?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/GETCHAR-non-blocking/m-p/753082#M7726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If this helps anyone, here is some code that does what I am looking for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define LPUART0_DATA&amp;nbsp;&amp;nbsp; &amp;nbsp;0x4005400C&amp;nbsp; &lt;STRONG&gt;//Address of the data register for the LPUART on the KL17&amp;nbsp;&lt;/STRONG&gt; &lt;BR /&gt;#define HW_REG_32(addr) (*((volatile unsigned long *) (addr))) &lt;STRONG&gt;//a macro to access the register or any 32 bit register.&lt;/STRONG&gt;&lt;BR /&gt;unsigned int reg32; &lt;STRONG&gt;//a place to put the register reading&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reg32 =&amp;nbsp;&amp;nbsp; &amp;nbsp;HW_REG_32(LPUART0_DATA);&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;//Read the register (non blocking)&lt;/STRONG&gt;&lt;BR /&gt;if(!(reg32 &amp;amp; 0x1000)) &lt;STRONG&gt;// look at the bit "receive Buffer Empty" from the register at address 0x4005400C&lt;/STRONG&gt;&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ch = (reg32 &amp;amp; 0xff);&amp;nbsp; &lt;STRONG&gt;//mask off what's not needed. &lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("got a char %c\r\n", ch); &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Doug&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 18:21:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/GETCHAR-non-blocking/m-p/753082#M7726</guid>
      <dc:creator>dougbaker</dc:creator>
      <dc:date>2017-12-06T18:21:38Z</dc:date>
    </item>
  </channel>
</rss>

