<?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: How can I test if GETCHAR() will block? in Kinetis Software Development Kit</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-can-I-test-if-GETCHAR-will-block/m-p/627720#M6635</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Robert,&lt;/P&gt;&lt;P&gt;I suppose that you have a host processor, the host processor can send instruction to MKL27 via UART interface. If it is the case, you do not need to call the &lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;GETCHAR&lt;/SPAN&gt;() function, you can set the UART of MKL27 in interrupt mode, once the host send an instruction to MKL27, the UART of MKL27 will receive the instruction and trigger an interrupt to MKL27 core so that user can deal with the instruction in UART ISR. You can use polling mode to check if the UART has received a char, the efficency of MKL27 is low in the mode.&lt;/P&gt;&lt;P&gt;In conclusion, I suggest you use UART interrupt mode, in the ISR of UART, you can write code to deal with the instruction from host.&lt;/P&gt;&lt;P&gt;Hope it can help you&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Dec 2016 02:52:22 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2016-12-21T02:52:22Z</dc:date>
    <item>
      <title>How can I test if GETCHAR() will block?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-can-I-test-if-GETCHAR-will-block/m-p/627719#M6634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are developing a device&amp;nbsp;around the&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;MKL27Z64xxx, and will be using its UART for calibration and testing. &amp;nbsp;The processor will be running a real-time process until the user types a character, at which point it will drop out of real time and do calls to&amp;nbsp;GETCHAR() to process the user input.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Is there a function call that will tell me if GETCHAR() has a character available, i.e., will not block when I call it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2016 23:47:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-can-I-test-if-GETCHAR-will-block/m-p/627719#M6634</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2016-12-19T23:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can I test if GETCHAR() will block?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-can-I-test-if-GETCHAR-will-block/m-p/627720#M6635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Robert,&lt;/P&gt;&lt;P&gt;I suppose that you have a host processor, the host processor can send instruction to MKL27 via UART interface. If it is the case, you do not need to call the &lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;GETCHAR&lt;/SPAN&gt;() function, you can set the UART of MKL27 in interrupt mode, once the host send an instruction to MKL27, the UART of MKL27 will receive the instruction and trigger an interrupt to MKL27 core so that user can deal with the instruction in UART ISR. You can use polling mode to check if the UART has received a char, the efficency of MKL27 is low in the mode.&lt;/P&gt;&lt;P&gt;In conclusion, I suggest you use UART interrupt mode, in the ISR of UART, you can write code to deal with the instruction from host.&lt;/P&gt;&lt;P&gt;Hope it can help you&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 02:52:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-can-I-test-if-GETCHAR-will-block/m-p/627720#M6635</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-12-21T02:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: How can I test if GETCHAR() will block?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-can-I-test-if-GETCHAR-will-block/m-p/627721#M6636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;XiangJun Rong:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your response! &amp;nbsp;What I ended up doing is writing a simple method 'hasChar()' for the LPUART as follows:&lt;/P&gt;&lt;PRE&gt;bool hasChar(LPUART_Type *base) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return !!(base-&amp;gt;STAT &amp;amp; LPUART_STAT_RDRF_MASK);
}&lt;/PRE&gt;&lt;P class=""&gt;... then all I need to do is call hasChar(). &amp;nbsp;If it returns true, then I can call getchar() and know that it won't block.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2016 23:27:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-can-I-test-if-GETCHAR-will-block/m-p/627721#M6636</guid>
      <dc:creator>robertpoor</dc:creator>
      <dc:date>2016-12-23T23:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I test if GETCHAR() will block?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-can-I-test-if-GETCHAR-will-block/m-p/627722#M6637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Obviously, you only read the Uart status register, you do NOT repeat reading the status register to poll the status, I am sure it will not block.&lt;/P&gt;&lt;P&gt;Hope it can help you.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Xiangjun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Dec 2016 09:32:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/How-can-I-test-if-GETCHAR-will-block/m-p/627722#M6637</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-12-26T09:32:06Z</dc:date>
    </item>
  </channel>
</rss>

