LIN协议栈 lin_frame_rx_handler 函数疑问
-
void lin_frame_rx_handler(uint32_t hwInst, void param)
{
else if(state->activeFrame->frameType == LIN_FRAME_TYPE_DIAG)
{
/ diag frame need copy to rx queue */
if((linState->rxSize) != state->activeFrame->bufLen)
{
state->frameStatus.errorInResp = l_true;
lin_tp_handle(inst, LIN_TP_RX_ERROR);
}
else
{
state->frameStatus.succTransfer = l_true;
#ifdef LIN_USE_UART
state->frameStatus.frameId=lin_id_to_pid(state->id);
#else
state->frameStatus.frameId=lin_id_to_pid(state->frameBuf.id);
#endif
}
}函数里的上面代码段,似乎有bug。rxSize是准备接收的长度,是通过 LIN_UART_DRV_RecvFrmData()函数调用传入设置的。 而传入的参数是获取自 activeFrame->bufLen。 把这两个参数进行比较永远相等,无意义。
快速上手云途开发生态
发帖前请查看
帮助改进和优化YT CONFIG TOOL,有机会抽取YTM32B1ME0 EVB哦...