<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[FR802x串口接收超时]]></title><description><![CDATA[<p>FR802x支持串口超时判断，使用方法是怎么样的？</p>
]]></description><link>http://www.freqchip.net:4567/topic/1865/fr802x串口接收超时</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 01:53:22 GMT</lastBuildDate><atom:link href="http://www.freqchip.net:4567/topic/1865.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 13 Jul 2026 08:53:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to FR802x串口接收超时 on Invalid Date]]></title><description><![CDATA[<p>FR802x支持串口超时判断，使用方法是怎么样的？</p>
]]></description><link>http://www.freqchip.net:4567/post/4560</link><guid isPermaLink="true">http://www.freqchip.net:4567/post/4560</guid><dc:creator><![CDATA[Mars]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to FR802x串口接收超时 on Invalid Date]]></title><description><![CDATA[<pre><code>
# define AT_RECV_MAX_LEN             513
static void app_at_recv_c(uint8_t *rx_buff,uint16_t rx_length)
{
   if((memcmp(at_recv_buffer,&quot;AT#&quot;,3)==0)||(memcmp(at_recv_buffer,&quot;AT+&quot;,3)==0))
   {
    uint16_t cmd_len=rx_length-3;
    
  struct app_task_event *event;
  event = app_task_event_alloc(APP_TASK_EVENT_AT_CMD, cmd_len, false);
  if(event) {
   memcpy(event-&gt;param, &amp;at_recv_buffer[3], cmd_len);
   app_task_event_post(event, false);
  }
    }
   else
   {
  struct app_task_event *event;
  event = app_task_event_alloc(APP_TASK_EVENT_SPEED, at_recv_index, false);
  if(event) {
   memcpy(event-&gt;param, at_recv_buffer, at_recv_index);
   app_task_event_post(event, false);
  }
  
   }
   memset(at_recv_buffer,0,AT_RECV_MAX_LEN);
 at_recv_index = 0;
}

extern USART_HandleTypeDef log_usart;
__RAM_CODE void USART2_IRQHandler(void)
{
  if((__USART_GET_INT_STATUS(USART2, USART_INT_RX)) || (__USART_GET_INT_STATUS(USART2, USART_INT_RFTO)))
    {
        if(log_usart.Init.DataLength == USART_DATA_LENGTH_9BIT)
        {
            /*Rx ready */
            while(__USART_GET_SR_STATUS(USART2, USART_STATUS_DR))
            {
                (*(uint16_t*)log_usart.p_RxData) = USART2-&gt;DR;

                log_usart.p_RxData += sizeof(uint16_t);
                log_usart.u32_RxCount++;
            }            
        }
        else
        {
            /* Rx ready */        
            while(__USART_GET_SR_STATUS(USART2, USART_STATUS_DR))
            {
                at_recv_buffer[at_recv_index++] = USART2-&gt;DR;
                if(at_recv_index&gt;=AT_RECV_MAX_LEN)
    {
     app_at_recv_c(&amp;at_recv_buffer[0],at_recv_index);
    }

            }            
        }

    }/* Receiver Timeout */
    if(__USART_GET_INT_STATUS(USART2, USART_INT_RTO))
    {
        __USART_CLEAN_INT_STATUS(USART2, USART_INT_RTO);
  at_recv_buffer[at_recv_index++] = USART2-&gt;DR;
//  for(uint8_t i=0;i&lt;at_recv_index;i++)
//  {
//   printf(&quot;%c &quot;,at_recv_buffer[i]);
//  }
//        printf(&quot;Packet Len = %d\r\n&quot;, at_recv_index);
        /*这里处理完整的数据包*/
  app_at_recv_c(&amp;at_recv_buffer[0],at_recv_index);
    }
}

</code></pre>
]]></description><link>http://www.freqchip.net:4567/post/4564</link><guid isPermaLink="true">http://www.freqchip.net:4567/post/4564</guid><dc:creator><![CDATA[Mars]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to FR802x串口接收超时 on Invalid Date]]></title><description><![CDATA[<p><img src="/assets/uploads/files/1783934501571-00c332a3-30c0-4e1e-ae6f-2604a27a6e62-image-resized.png" alt="0_1783934500681_00c332a3-30c0-4e1e-ae6f-2604a27a6e62-image.png" class="img-responsive img-markdown" /> <img src="/assets/uploads/files/1783934504970-ef57988a-4ff7-488c-84c6-4f18b17a20e9-image-resized.png" alt="0_1783934504646_ef57988a-4ff7-488c-84c6-4f18b17a20e9-image.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://www.freqchip.net:4567/post/4565</link><guid isPermaLink="true">http://www.freqchip.net:4567/post/4565</guid><dc:creator><![CDATA[Mars]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>