<?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[LIN协议栈 lin_frame_rx_handler 函数疑问]]></title><description><![CDATA[<p dir="auto">void lin_frame_rx_handler(uint32_t hwInst, void <em>param)<br />
{<br />
else if(state-&gt;activeFrame-&gt;frameType == LIN_FRAME_TYPE_DIAG)<br />
{<br />
/</em> diag frame need copy to rx queue */<br />
if((linState-&gt;rxSize) != state-&gt;activeFrame-&gt;bufLen)<br />
{<br />
state-&gt;frameStatus.errorInResp = l_true;<br />
lin_tp_handle(inst, LIN_TP_RX_ERROR);<br />
}<br />
else<br />
{<br />
state-&gt;frameStatus.succTransfer = l_true;<br />
#ifdef LIN_USE_UART<br />
state-&gt;frameStatus.frameId=lin_id_to_pid(state-&gt;id);<br />
#else<br />
state-&gt;frameStatus.frameId=lin_id_to_pid(state-&gt;<a href="http://frameBuf.id" rel="nofollow ugc">frameBuf.id</a>);<br />
#endif<br />
}<br />
}</p>
<p dir="auto">函数里的上面代码段，似乎有bug。rxSize是准备接收的长度，是通过 LIN_UART_DRV_RecvFrmData()函数调用传入设置的。   而传入的参数是获取自 activeFrame-&gt;bufLen。 把这两个参数进行比较永远相等，无意义。</p>
]]></description><link>https://forum.ytmicro.com/topic/1992/lin协议栈-lin_frame_rx_handler-函数疑问</link><generator>RSS for Node</generator><lastBuildDate>Tue, 02 Jun 2026 18:00:31 GMT</lastBuildDate><atom:link href="https://forum.ytmicro.com/topic/1992.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 02 Jun 2026 13:02:52 GMT</pubDate><ttl>60</ttl></channel></rss>