В UDS добавлен VIN learn
This commit is contained in:
parent
0219418559
commit
51b10baa5a
|
|
@ -12,6 +12,8 @@
|
|||
#define LOG_SIGN "CAN_RECEIVED"
|
||||
#define LOGGER env->logger
|
||||
|
||||
char GET_HVAC_VIN[17] = {'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'};
|
||||
|
||||
void CanSpamReceiver_Init(tCanSpamReceiver *env,
|
||||
tSerialPortFrameIO *ioCanFrame,
|
||||
tLoggerInterface *logger) {
|
||||
|
|
@ -21,6 +23,8 @@ void CanSpamReceiver_Init(tCanSpamReceiver *env,
|
|||
env->access = osMutexNew(NULL);
|
||||
|
||||
|
||||
env->ccu_candb_rx_LOCAL_HVAC_VIN = osMessageQueueNew(1, sizeof(GET_HVAC_VIN), NULL);
|
||||
env->ccu_candb_rx_LOCAL_HVAC_UDS_VIN = osMessageQueueNew(1, sizeof(GET_HVAC_VIN), NULL);
|
||||
env->ccu_candb_rx_TM_CP = osMessageQueueNew(1, sizeof(ccu_candb_rx.TM_CP), NULL);
|
||||
env->ccu_candb_rx_FIU_CCU1 = osMessageQueueNew(1, sizeof(ccu_candb_rx.FIU_CCU1), NULL);
|
||||
env->ccu_candb_rx_FIU_CCU2 = osMessageQueueNew(1, sizeof(ccu_candb_rx.FIU_CCU2), NULL);
|
||||
|
|
@ -34,7 +38,8 @@ void CanSpamReceiver_Init(tCanSpamReceiver *env,
|
|||
|
||||
|
||||
env->thread.stack = tCanSpamReceiver_stack;
|
||||
InitThreadAtr(&env->thread.attr,"CanSpamRec",&env->thread.controlBlock,sizeof(env->thread.controlBlock),env->thread.stack,tCanSpamReceiver_stack_size,osPriorityNormal);
|
||||
InitThreadAtr(&env->thread.attr, "CanSpamRec", &env->thread.controlBlock, sizeof(env->thread.controlBlock),
|
||||
env->thread.stack, tCanSpamReceiver_stack_size, osPriorityNormal);
|
||||
env->thread.id = 0;
|
||||
|
||||
// InitThreadAtrStatic(&env->thread.attr, "CanSpamRec", env->thread.controlBlock, env->thread.stack,
|
||||
|
|
@ -47,51 +52,111 @@ static void set_CanSpamReceiver(tCanSpamReceiver *env, uint32_t recid) {
|
|||
uint32_t countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_TM_CP);
|
||||
if ((countQueue_ccu_candb_rx) && (recid == TM_CP_CANID)) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_TM_CP, &ccu_candb_rx.TM_CP, 0, 0U);
|
||||
return;
|
||||
}
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_FIU_CCU1);
|
||||
if ((countQueue_ccu_candb_rx) && (recid == FIU_CCU1_CANID)) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_FIU_CCU1, &ccu_candb_rx.FIU_CCU1, 0, 0U);
|
||||
return;
|
||||
}
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_FIU_CCU2);
|
||||
if ((countQueue_ccu_candb_rx) && (recid == FIU_CCU2_CANID)) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_FIU_CCU2, &ccu_candb_rx.FIU_CCU2, 0, 0U);
|
||||
return;
|
||||
}
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_BCM_Powertrain);
|
||||
if ((countQueue_ccu_candb_rx) && (recid == BCM_Powertrain_CANID)) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_BCM_Powertrain, &ccu_candb_rx.BCM_Powertrain, 0, 0U);
|
||||
return;
|
||||
}
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_BCM_CLIMATIC_DATA);
|
||||
if ((countQueue_ccu_candb_rx) && (recid == BCM_CLIMATIC_DATA_CANID)) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_BCM_CLIMATIC_DATA, &ccu_candb_rx.BCM_CLIMATIC_DATA, 0, 0U);
|
||||
return;
|
||||
}
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_EMS_Veh);
|
||||
if ((countQueue_ccu_candb_rx) && (recid == EMS_Veh_CANID)) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_EMS_Veh, &ccu_candb_rx.EMS_Veh, 0, 0U);
|
||||
return;
|
||||
}
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_ESC_04);
|
||||
if ((countQueue_ccu_candb_rx) && (recid == ESC_04_CANID)) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_ESC_04, &ccu_candb_rx.ESC_04, 0, 0U);
|
||||
return;
|
||||
}
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_BCM_VEH_STATE);
|
||||
if ((countQueue_ccu_candb_rx) && (recid == BCM_VEH_STATE_CANID)) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_BCM_VEH_STATE, &ccu_candb_rx.BCM_VEH_STATE, 0, 0U);
|
||||
return;
|
||||
}
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_EMS_HVC_Req_Msg);
|
||||
if ((countQueue_ccu_candb_rx) && (recid == EMS_HVC_Req_Msg_CANID)) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_EMS_HVC_Req_Msg, &ccu_candb_rx.EMS_HVC_Req_Msg, 0, 0U);
|
||||
return;
|
||||
}
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_HVC_Err_Status_Msg);
|
||||
if ((countQueue_ccu_candb_rx) && (recid == HVC_Err_Status_Msg_CANID)) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_HVC_Err_Status_Msg, &ccu_candb_rx.HVC_Err_Status_Msg, 0, 0U);
|
||||
return;
|
||||
}
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_LOCAL_HVAC_VIN);
|
||||
if ((countQueue_ccu_candb_rx) && (recid == VEH_VIN_CANID)) {
|
||||
|
||||
if (ccu_candb_rx.VEH_VIN.VIN_Addressing == 0) {
|
||||
env->SET_HVAC_VIN[0] = ccu_candb_rx.VEH_VIN.VIN_Char1;
|
||||
env->SET_HVAC_VIN[1] = ccu_candb_rx.VEH_VIN.VIN_Char2;
|
||||
env->SET_HVAC_VIN[2] = ccu_candb_rx.VEH_VIN.VIN_Char3;
|
||||
env->SET_HVAC_VIN[3] = ccu_candb_rx.VEH_VIN.VIN_Char4;
|
||||
env->SET_HVAC_VIN[4] = ccu_candb_rx.VEH_VIN.VIN_Char5;
|
||||
env->SET_HVAC_VIN[5] = ccu_candb_rx.VEH_VIN.VIN_Char6;
|
||||
env->SET_HVAC_VIN[6] = ccu_candb_rx.VEH_VIN.VIN_Char7;
|
||||
env->getVIN0 = true;
|
||||
}
|
||||
|
||||
if (ccu_candb_rx.VEH_VIN.VIN_Addressing == 1) {
|
||||
env->SET_HVAC_VIN[7] = ccu_candb_rx.VEH_VIN.VIN_Char8;
|
||||
env->SET_HVAC_VIN[8] = ccu_candb_rx.VEH_VIN.VIN_Char9;
|
||||
env->SET_HVAC_VIN[9] = ccu_candb_rx.VEH_VIN.VIN_Char10;
|
||||
env->SET_HVAC_VIN[10] = ccu_candb_rx.VEH_VIN.VIN_Char11;
|
||||
env->SET_HVAC_VIN[11] = ccu_candb_rx.VEH_VIN.VIN_Char12;
|
||||
env->SET_HVAC_VIN[12] = ccu_candb_rx.VEH_VIN.VIN_Char13;
|
||||
env->SET_HVAC_VIN[13] = ccu_candb_rx.VEH_VIN.VIN_Char14;
|
||||
env->getVIN1 = true;
|
||||
}
|
||||
|
||||
if (ccu_candb_rx.VEH_VIN.VIN_Addressing == 2) {
|
||||
env->SET_HVAC_VIN[14] = ccu_candb_rx.VEH_VIN.VIN_Char15;
|
||||
env->SET_HVAC_VIN[15] = ccu_candb_rx.VEH_VIN.VIN_Char16;
|
||||
env->SET_HVAC_VIN[16] = ccu_candb_rx.VEH_VIN.VIN_Char17;
|
||||
env->getVIN2 = true;
|
||||
}
|
||||
|
||||
if ((env->getVIN0) && (env->getVIN1) && (env->getVIN2)) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_LOCAL_HVAC_VIN, env->SET_HVAC_VIN, 0, 0U);
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_LOCAL_HVAC_UDS_VIN);
|
||||
|
||||
if (countQueue_ccu_candb_rx) {
|
||||
status = osMessageQueuePut(env->ccu_candb_rx_LOCAL_HVAC_UDS_VIN, env->SET_HVAC_VIN, 0, 0U);
|
||||
}
|
||||
|
||||
env->getVIN0 = false;
|
||||
env->getVIN1 = false;
|
||||
env->getVIN2 = false;
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -205,6 +270,11 @@ void get_CanSpamReceiver(tCanSpamReceiver *env) {
|
|||
status = osMessageQueueGet(env->ccu_candb_rx_HVC_Err_Status_Msg, &rtDW.HVC_ERR_STATUS_MSG_MODEL, 0, 0U);
|
||||
}
|
||||
|
||||
countQueue_ccu_candb_rx = osMessageQueueGetSpace(env->ccu_candb_rx_LOCAL_HVAC_VIN);
|
||||
if (countQueue_ccu_candb_rx == 0) {
|
||||
status = osMessageQueueGet(env->ccu_candb_rx_LOCAL_HVAC_VIN, GET_HVAC_VIN, 0, 0U);
|
||||
}
|
||||
|
||||
/*
|
||||
if (osMutexAcquire(env->access, 5000) == osOK) {
|
||||
memcpy(&rtDW.TM_CP_model, &ccu_candb_rx.TM_CP, sizeof(rtDW.TM_CP_model));
|
||||
|
|
@ -235,6 +305,34 @@ void get_CanSpamReceiver(tCanSpamReceiver *env) {
|
|||
|
||||
}
|
||||
|
||||
bool get_CanSpamReceiverUDS(tCanSpamReceiver *env, char *VIN, func_update_func update_func, void *update_func_env,
|
||||
uint32_t timeout, uint32_t count) {
|
||||
|
||||
|
||||
uint32_t u32Time = SystemGetMs() + timeout;
|
||||
|
||||
|
||||
for (uint32_t i=0; i<count; ++i) {
|
||||
|
||||
osStatus_t status = osMessageQueueGet(env->ccu_candb_rx_LOCAL_HVAC_UDS_VIN, VIN, 0, timeout);
|
||||
|
||||
if (update_func != NULL) {
|
||||
if (SystemGetMs() > u32Time) {
|
||||
update_func(update_func_env);
|
||||
u32Time = SystemGetMs() + timeout;
|
||||
}
|
||||
}
|
||||
|
||||
if (status == osOK) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static _Noreturn void CanSpamReceiver_Thread(tCanSpamReceiver *env) {
|
||||
for (;;) {
|
||||
ListenCanSpamReceiver(env);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include "CanSerialPortFrame.h"
|
||||
#include "ccu_candb-binutil.h"
|
||||
#include "LoggerInterface.h"
|
||||
#include "crc32_m7.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -17,6 +18,14 @@ typedef struct {
|
|||
osMutexId_t access;
|
||||
can_rx_message_type canFrame;
|
||||
|
||||
char SET_HVAC_VIN[17];
|
||||
bool getVIN0;
|
||||
bool getVIN1;
|
||||
bool getVIN2;
|
||||
|
||||
|
||||
osMessageQueueId_t ccu_candb_rx_LOCAL_HVAC_VIN;
|
||||
osMessageQueueId_t ccu_candb_rx_LOCAL_HVAC_UDS_VIN;
|
||||
osMessageQueueId_t ccu_candb_rx_TM_CP;
|
||||
osMessageQueueId_t ccu_candb_rx_FIU_CCU1;
|
||||
osMessageQueueId_t ccu_candb_rx_FIU_CCU2;
|
||||
|
|
@ -46,6 +55,9 @@ void CanSpamReceiver_StartThread(tCanSpamReceiver *env);
|
|||
|
||||
void get_CanSpamReceiver(tCanSpamReceiver *env);
|
||||
|
||||
bool get_CanSpamReceiverUDS(tCanSpamReceiver *env, char *VIN, func_update_func update_func, void *update_func_env,
|
||||
uint32_t timeout, uint32_t count);
|
||||
|
||||
bool get_is_NoNull_CanSpam_BCM_PowerTrain_Receiver(tCanSpamReceiver *env);
|
||||
|
||||
#endif //HVAC_CAN_SPAM_RECEIVER_H
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ static uint16_t getActProc(uint16_t maxPos, uint16_t pos) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
// Тут данные должны быть с модели &env->Status_Sensor_For_Model_input и т.д.
|
||||
void CanUdsInput_Set_Model(tCanUds *env) {
|
||||
osStatus_t status = osOK;
|
||||
|
|
@ -660,7 +659,6 @@ static void setDefaultValue(tCanUds *env) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
static char strPrintfDebug_UDS[80];
|
||||
|
||||
static void PrintfDebug(uint8_t *data, uint8_t dlc) {
|
||||
|
|
@ -850,11 +848,13 @@ void setResponseErrorPending(tCanUds *env, eUdsServices service, eUdsResponseErr
|
|||
env->dataResponsePending[1] = service;
|
||||
env->dataResponsePending[2] = error;
|
||||
|
||||
env->currentSessionTesterPresentTimeout = SystemGetMs() + timeout_session_S3_Server;
|
||||
|
||||
CanSerialPortFrameTpTransmit(&env->canSerialPortFrameTp, env->dataResponsePending,
|
||||
3, PROTOCOL_CAN_ADR_UDS, WAIT_FRAME_WRITE);
|
||||
}
|
||||
|
||||
void SendUpdatePendingCrc(void *env) {
|
||||
void SendUpdatePendingRoutine(void *env) {
|
||||
setResponseErrorPending(env, UDS_RoutineControl, UDS_error_requestCorrectlyReceived_ResponsePending);
|
||||
}
|
||||
|
||||
|
|
@ -1153,7 +1153,8 @@ static uint16_t WriteDataByIdentifier_2E(tCanUds *env) {
|
|||
// начало --------------------------- Управление ---------------------------------------------------------
|
||||
static void GetUpdateQueueIO(tCanUds *env) {
|
||||
|
||||
setResponseErrorPending(env, UDS_InputOutputControlByIdentifier, UDS_error_requestCorrectlyReceived_ResponsePending);
|
||||
setResponseErrorPending(env, UDS_InputOutputControlByIdentifier,
|
||||
UDS_error_requestCorrectlyReceived_ResponsePending);
|
||||
|
||||
for (uint8_t i = 0; i < 15; ++i) {
|
||||
CanUdsOutput_Set_Model(env);
|
||||
|
|
@ -1705,7 +1706,21 @@ static uint16_t vUDS_routine_VIN_learn(tCanUds *env, eUdsRoutineControlType udsR
|
|||
return 0xFF00 | UDS_error_sub_functionNotSupported;
|
||||
}
|
||||
|
||||
bool isVIN = get_CanSpamReceiverUDS(env->canSpamReceiver, env->VIN, SendUpdatePendingRoutine, env, 200, 200);
|
||||
|
||||
if (isVIN) {
|
||||
|
||||
memcpy(statusData.ecu.Vehicle_Identification, env->VIN, 17);
|
||||
|
||||
SendUpdatePendingRoutine(env);
|
||||
SaveToStorageFromStatusData(env->deviceStorage, &statusData.ecu);
|
||||
|
||||
env->dataResponse[4] = UDS_routine_RoutineStartStopSuccess;
|
||||
} else {
|
||||
|
||||
env->dataResponse[4] = UDS_routine_RoutineStartStopFailure;
|
||||
}
|
||||
|
||||
|
||||
return 4 + 1;
|
||||
}
|
||||
|
|
@ -1724,7 +1739,7 @@ static uint16_t vUDS_routine_Compare_Checksum(tCanUds *env, eUdsRoutineControlTy
|
|||
setResponseErrorPending(env, UDS_RoutineControl, UDS_error_requestCorrectlyReceived_ResponsePending);
|
||||
|
||||
uint32_t crc32_calc = UdsCrc32Update_Hardware(0xFFFFFFFF, (uint8_t *) env->CurrentBlockAdr, env->CurrentBlockSize,
|
||||
SendUpdatePendingCrc, env, 200);
|
||||
SendUpdatePendingRoutine, env, 200);
|
||||
|
||||
uint32_t crc32_received =
|
||||
(env->data->data[4] << 24) | (env->data->data[5] << 16) | (env->data->data[6] << 8) | env->data->data[7];
|
||||
|
|
@ -1941,7 +1956,7 @@ vUDS_routine_Check_Programming_Dependancies(tCanUds *env, eUdsRoutineControlType
|
|||
setResponseErrorPending(env, UDS_RoutineControl, UDS_error_requestCorrectlyReceived_ResponsePending);
|
||||
uint32_t crc32_calc = UdsCrc32Update_Hardware(0xFFFFFFFF, (uint8_t *) ADR_HEX_Mapped_BlockMain,
|
||||
SIZE_HEX_BlockMain - 4,
|
||||
SendUpdatePendingCrc, env, 200);
|
||||
SendUpdatePendingRoutine, env, 200);
|
||||
|
||||
uint32_t crc32_file = (*(uint32_t *) (ADR_HEX_Mapped_BlockMain + SIZE_HEX_BlockMain - 4));
|
||||
|
||||
|
|
@ -1953,7 +1968,7 @@ vUDS_routine_Check_Programming_Dependancies(tCanUds *env, eUdsRoutineControlType
|
|||
|
||||
setResponseErrorPending(env, UDS_RoutineControl, UDS_error_requestCorrectlyReceived_ResponsePending);
|
||||
crc32_calc = UdsCrc32Update_Hardware(0xFFFFFFFF, (uint8_t *) ADR_HEX_Mapped_BlockCalib, SIZE_HEX_BlockCalib - 4,
|
||||
SendUpdatePendingCrc, env, 200);
|
||||
SendUpdatePendingRoutine, env, 200);
|
||||
|
||||
crc32_file = (*(uint32_t *) (ADR_HEX_Mapped_BlockCalib + SIZE_HEX_BlockCalib - 4));
|
||||
|
||||
|
|
@ -2838,6 +2853,7 @@ void CanUds_Init(
|
|||
tDiagnostic *Diagnostic,
|
||||
tSerialPortFrameIO *CanIO,
|
||||
tDeviceStorage *deviceStorage,
|
||||
tCanSpamReceiver *canSpamReceiver,
|
||||
tCanSpamTransmitter *canSpamTransmitter,
|
||||
tCanSpamDebugTransmitter *canSpamDebugTransmitter,
|
||||
tAdc0Task *adcTask0,
|
||||
|
|
@ -2848,6 +2864,7 @@ void CanUds_Init(
|
|||
env->logger = logger;
|
||||
env->CanIO = CanIO;
|
||||
env->deviceStorage = deviceStorage;
|
||||
env->canSpamReceiver = canSpamReceiver;
|
||||
env->Diagnostic = Diagnostic;
|
||||
env->adcTask0 = adcTask0;
|
||||
env->filterIdCount = 2;
|
||||
|
|
@ -2938,7 +2955,8 @@ void CanUds_Init(
|
|||
|
||||
|
||||
env->thread_Uds.stack = tCanUds_stack;
|
||||
InitThreadAtr(&env->thread_Uds.attr,"UdsTester",&env->thread_Uds.controlBlock,sizeof(env->thread_Uds.controlBlock),env->thread_Uds.stack,tCanUds_stack_size,osPriorityNormal);
|
||||
InitThreadAtr(&env->thread_Uds.attr, "UdsTester", &env->thread_Uds.controlBlock,
|
||||
sizeof(env->thread_Uds.controlBlock), env->thread_Uds.stack, tCanUds_stack_size, osPriorityNormal);
|
||||
env->thread_Uds.id = 0;
|
||||
|
||||
// InitThreadBlock(env->T_can_Uds, "UdsTester", osPriorityNormal);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include "CanSpamDebugTransmitter.h"
|
||||
#include "AdcTasks.h"
|
||||
#include "StatusData.h"
|
||||
#include "CanSpamReceiver.h"
|
||||
|
||||
#define LOG_UDS 0
|
||||
|
||||
|
|
@ -204,10 +205,13 @@ typedef struct {
|
|||
eUdsSession currentSession;
|
||||
uint32_t currentSessionTesterPresentTimeout;
|
||||
|
||||
tCanSpamReceiver *canSpamReceiver;
|
||||
|
||||
tCanSpamTransmitter *canSpamTransmitter;
|
||||
// tCanSpamSlowTransmitter *canSpamSlowTransmitter;
|
||||
tCanSpamDebugTransmitter *canSpamDebugTransmitter;
|
||||
|
||||
|
||||
uint32_t randomSecuritySeed;
|
||||
|
||||
struct {
|
||||
|
|
@ -232,6 +236,8 @@ typedef struct {
|
|||
uint32_t CurrentBlockAdr;
|
||||
uint32_t CurrentBlockSize;
|
||||
|
||||
char VIN[17];
|
||||
|
||||
bool isEcuReset;
|
||||
|
||||
uint32_t timeoutPendingClear;
|
||||
|
|
@ -289,6 +295,7 @@ typedef struct {
|
|||
|
||||
Status_Sensor_Bus Status_Sensort_model_IO_local;
|
||||
|
||||
|
||||
struct {
|
||||
osThreadId_t id;
|
||||
//uint32_t stack[384];
|
||||
|
|
@ -314,6 +321,7 @@ void CanUds_Init(
|
|||
tDiagnostic *Diagnostic,
|
||||
tSerialPortFrameIO *CanIO,
|
||||
tDeviceStorage *deviceStorage,
|
||||
tCanSpamReceiver *canSpamReceiver,
|
||||
tCanSpamTransmitter *canSpamTransmitter,
|
||||
tCanSpamDebugTransmitter *canSpamDebugTransmitter,
|
||||
tAdc0Task *adcTask0,
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ static const uint32_t crc_table[256] = {
|
|||
|
||||
|
||||
uint32_t
|
||||
UdsCrc32Update(uint32_t crc, const uint8_t *data, uint32_t len, crc32_update_func update_func, void *update_func_env,
|
||||
UdsCrc32Update(uint32_t crc, const uint8_t *data, uint32_t len, func_update_func update_func, void *update_func_env,
|
||||
uint32_t timeout) {
|
||||
|
||||
uint32_t time = SystemGetMs() + timeout;
|
||||
|
|
@ -111,7 +111,7 @@ uint32_t UdsCrc32Finalize(uint32_t crc) {
|
|||
* @return uint32_t Updated CRC value
|
||||
*/
|
||||
uint32_t UdsCrc32Update_Hardware(uint32_t crc, const uint8_t *data, uint32_t len,
|
||||
crc32_update_func update_func, void *update_func_env,
|
||||
func_update_func update_func, void *update_func_env,
|
||||
uint32_t timeout)
|
||||
{
|
||||
CRC_InitType tInitCfg = {0};
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@
|
|||
#define HVAC_M7_CRC32_UDS_H
|
||||
#include "stdint.h"
|
||||
|
||||
typedef void (crc32_update_func)(void *update_func_env);
|
||||
typedef void (func_update_func)(void *update_func_env);
|
||||
|
||||
uint32_t UdsCrc32Update(uint32_t crc, const uint8_t *data, uint32_t len, crc32_update_func update_func, void *update_func_env, uint32_t timeout);
|
||||
uint32_t UdsCrc32Update(uint32_t crc, const uint8_t *data, uint32_t len, func_update_func update_func, void *update_func_env, uint32_t timeout);
|
||||
uint32_t UdsCrc32Finalize(uint32_t crc);
|
||||
uint32_t UdsCrc32Update_Hardware(uint32_t crc, const uint8_t *data, uint32_t len,
|
||||
crc32_update_func update_func, void *update_func_env,
|
||||
func_update_func update_func, void *update_func_env,
|
||||
uint32_t timeout);
|
||||
|
||||
#endif //HVAC_M7_CRC32_UDS_H
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ const FilterTo_FLEXCAN_RxMbFilterType IdCanHardSoftFilterCan0[countIdCanHardSoft
|
|||
*/
|
||||
|
||||
|
||||
#define countIdCanHardSoftFilterCan0 13
|
||||
#define countIdCanHardSoftFilterCan0 14
|
||||
const FilterTo_FLEXCAN_RxMbFilterType IdCanHardSoftFilterCan0[countIdCanHardSoftFilterCan0] = {
|
||||
{FLEXCAN_ID_STD, Diag_To_CCU_CANID, 0x7FF, PROTOCOL_CAN_UDS},
|
||||
{FLEXCAN_ID_STD, Diag_Functional_CANID, 0x7FF, PROTOCOL_CAN_UDS},
|
||||
|
|
@ -184,7 +184,7 @@ const FilterTo_FLEXCAN_RxMbFilterType IdCanHardSoftFilterCan0[countIdCanHardSoft
|
|||
// {FLEXCAN_ID_STD, SMRL_status_CANID, 0x7FF, PROTOCOL_CAN_RAW},
|
||||
// {FLEXCAN_ID_STD, SMRR_status_CANID, 0x7FF, PROTOCOL_CAN_RAW},
|
||||
// {FLEXCAN_ID_STD, SDM_Cmd_CANID, 0x7FF, PROTOCOL_CAN_RAW},
|
||||
// {FLEXCAN_ID_STD, VEH_VIN_CANID, 0x7FF, PROTOCOL_CAN_RAW},
|
||||
{FLEXCAN_ID_STD, VEH_VIN_CANID, 0x7FF, PROTOCOL_CAN_RAW},
|
||||
// {FLEXCAN_ID_STD, OCUFL_MSG_CANID, 0x7FF, PROTOCOL_CAN_RAW},
|
||||
// {FLEXCAN_ID_STD, OCUFR_MSG_CANID, 0x7FF, PROTOCOL_CAN_RAW},
|
||||
// {FLEXCAN_ID_STD, OCURL_MSG_CANID, 0x7FF, PROTOCOL_CAN_RAW},
|
||||
|
|
|
|||
|
|
@ -265,6 +265,7 @@ static void Mma_InitSubSystems(tMma *env) {
|
|||
&env->Diagnostic,
|
||||
&env->canPorts->Can0_IO,
|
||||
&env->storage,
|
||||
&env->canSpamReceiver,
|
||||
&env->canSpamTransmitter,
|
||||
&env->canSpamDebugTransmitter,
|
||||
&env->adcTask0,
|
||||
|
|
|
|||
Loading…
Reference in New Issue