<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF52840 Zephyr UART Callback</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66836/nrf52840-zephyr-uart-callback</link><description>Hello, 
 Currently I have implemented a UART callback using the CONFIG_UART_ASYNC_API setting as follows: 
 However, all data that I receive is appended constantly, until the buffer is full. I would like to empty the buffer every time UART_RX_RDY is received</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Oct 2020 07:36:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66836/nrf52840-zephyr-uart-callback" /><item><title>RE: nRF52840 Zephyr UART Callback</title><link>https://devzone.nordicsemi.com/thread/273642?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 07:36:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adec7507-6668-430c-a15a-920496006ae3</guid><dc:creator>newUser</dc:creator><description>&lt;p&gt;Solved:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;case UART_RX_RDY:
{
  uart_rx_disable(uart_dev);
  
  printk(&amp;quot;%s\n&amp;quot;, recv_buf);
  memset(recv_buf, 0, sizeof(recv_buf));

  uart_rx_enable(uart_dev, recv_buf, sizeof(recv_buf), MODEM_RX_TIMEOUT);
}
break;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>