Обновление

This commit is contained in:
cfif 2025-12-12 15:09:20 +03:00
parent c1429a5ad3
commit 8a75a195d3
1 changed files with 14 additions and 11 deletions

View File

@ -336,20 +336,20 @@ static uint8_t LIN_DrvMakeCheckSum(uint8_t u8LinIndex, uint8_t *pBuf, uint8_t u8
uint16_t u16Checksum = 0U; uint16_t u16Checksum = 0U;
uint8_t u8Length = 0U; uint8_t u8Length = 0U;
if ((pConfig->numOfClassicPID == 0U) || (pConfig->numOfClassicPID == 255U)) // if ((pConfig->numOfClassicPID == 0U) || (pConfig->numOfClassicPID == 255U))
{ // {
if (pConfig->classicPID != NULL) if (pConfig->classicPID != NULL)
{ {
for (uint8_t i = 0U; i < pConfig->numOfClassicPID; i++) // for (uint8_t i = 0U; i < pConfig->numOfClassicPID; i++)
{ // {
if (u8Pid == pConfig->classicPID[i]) // if (u8Pid == pConfig->classicPID[i])
{ // {
u8Pid = 0U; u8Pid = 0U;
break; // break;
} // }
} // }
} }
} // }
/* For PID is 0x3C (ID 0x3C) or 0x7D (ID 0x3D) or 0xFE (ID 0x3E) or 0xBF (ID 0x3F)*/ /* For PID is 0x3C (ID 0x3C) or 0x7D (ID 0x3D) or 0xFE (ID 0x3E) or 0xBF (ID 0x3F)*/
if ((0x3CU == u8Pid) || (0x7DU == u8Pid) || (0xFEU == u8Pid) || (0xBFU == u8Pid)) if ((0x3CU == u8Pid) || (0x7DU == u8Pid) || (0xFEU == u8Pid) || (0xBFU == u8Pid))
@ -392,7 +392,7 @@ static void LIN_DrvReceiveFrameData(uint8_t u8LinIndex, uint8_t u8ReceiveByte)
xferState->checkSum = u8ReceiveByte; xferState->checkSum = u8ReceiveByte;
xferState->rxBuff -= (xferState->rxSize - 1U); xferState->rxBuff -= (xferState->rxSize - 1U);
/* Checksun compared. */ // Checksun compared.
if (xferState->checkSum == LIN_DrvMakeCheckSum(u8LinIndex, xferState->rxBuff, if (xferState->checkSum == LIN_DrvMakeCheckSum(u8LinIndex, xferState->rxBuff,
xferState->rxSize - 1U, xferState->currentPid)) xferState->rxSize - 1U, xferState->currentPid))
{ {
@ -487,6 +487,7 @@ static void LIN_DrvSendFrameData(uint8_t u8LinIndex, uint8_t u8ReceiveByte)
/** /**
* @brief Handle the frame data, sending or receiving frame data. * @brief Handle the frame data, sending or receiving frame data.
*/ */
static void LIN_DrvFrameHandle(uint8_t u8LinIndex) static void LIN_DrvFrameHandle(uint8_t u8LinIndex)
{ {
lin_xfer_state_t *xferState = s_aLinXfer[u8LinIndex]; lin_xfer_state_t *xferState = s_aLinXfer[u8LinIndex];
@ -632,6 +633,8 @@ LIN_StatusType LIN_DrvInit(uint8_t u8LinIndex, lin_config_t *pConfig)
* - 8 bits transfer mode enabled; * - 8 bits transfer mode enabled;
* - Parity check mode disable; * - Parity check mode disable;
*/ */
//FCUART_CTRL_IDLECFG(FCUART_IDLE_CHARCTER_128)
u32CtrlRegValue |= FCUART_CTRL_FEIE(1U) | FCUART_CTRL_RIE(1U) | FCUART_CTRL_BMSEL(0U) | FCUART_CTRL_PE(0U); u32CtrlRegValue |= FCUART_CTRL_FEIE(1U) | FCUART_CTRL_RIE(1U) | FCUART_CTRL_BMSEL(0U) | FCUART_CTRL_PE(0U);
FCUART_HWA_SetCtrl(base, u32CtrlRegValue); FCUART_HWA_SetCtrl(base, u32CtrlRegValue);