Configuração CanLPduReceiveCalloutFunction do módulo CAN em MCAL

CanLPduReceiveCalloutFunção

1. Encontre o módulo "CanLPduReceiveCalloutFunction"

Encontre "Can" - "General" - "CanLPduReceiveCalloutFunction" por sua vez

insira a descrição da imagem aqui

2. Escrevendo a função Callout

A forma é a seguinte: (filtro CanId == 0x123, não carregue para a camada COM)

boolean ComCdd_CanIfRxIndicationHook(uint8 Hrh, uint32 CanId, uint8 CanDataLegth, uint8* CanSduPtr)
{
  if (CanId == 0x123) // CanId
  {
​    ComCdd_CRS_DataCallback(CanId, CanSduPtr, CanDataLegth);
​    return false; // stop further processing in CanIfRxIndication
  }
  else
  {
​    return true; // further processing in CanIfRxIndication
  }

}

3. O valor de retorno da função Callout

Quando a função retorna falso,

Este LPDU não será carregado posteriormente e a função CanIf_RxIndication não será chamada

(O código acima é entregue à função personalizada ComCdd_CRS_DataCallback antecipadamente para processamento);

Quando a função retorna verdadeiro,

Este LPDU é carregado na camada COM;

insira a descrição da imagem aqui

insira a descrição da imagem aqui

3. terminar

Catálogo Geral de "AUTOSAR Genealogy Decomposition (ETAS Toolchain)"

Acho que você gosta

Origin blog.csdn.net/PlutoZuo/article/details/132543838
Recomendado
Clasificación