增加OTA功能
This commit is contained in:
parent
c0566fa91b
commit
ffe5d7b515
Binary file not shown.
BIN
OBJ/App.bin
BIN
OBJ/App.bin
Binary file not shown.
4498
OBJ/DCBms.hex
4498
OBJ/DCBms.hex
File diff suppressed because it is too large
Load Diff
4498
OBJ/LED.hex
4498
OBJ/LED.hex
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -5,7 +5,8 @@
|
|||||||
|
|
||||||
#pragma anon_unions
|
#pragma anon_unions
|
||||||
|
|
||||||
#define PROGRAMMING_PASS_TIMEOUT_TIME 500 //5s
|
#define PROGRAMMING_PASS_TIMEOUT_TIME 500 //5s base:10ms
|
||||||
|
#define OTA_TIMEOUT_TIME (6) //30min base:5min
|
||||||
|
|
||||||
/*
|
/*
|
||||||
INPUT_OVERVOLTAGE) \
|
INPUT_OVERVOLTAGE) \
|
||||||
@ -46,7 +47,7 @@ typedef struct {
|
|||||||
uint16_t CurrDcVolt; //当前直流电压 0.1V
|
uint16_t CurrDcVolt; //当前直流电压 0.1V
|
||||||
uint8_t ChargeTemp; //充电座温度值 °C
|
uint8_t ChargeTemp; //充电座温度值 °C
|
||||||
uint8_t BoardTemp; //板载温度值 °C
|
uint8_t BoardTemp; //板载温度值 °C
|
||||||
uint8_t OtaModeSts; //OTA ģʽ״̬ 0:not in ota 1:in transition ota 2:in ota
|
// uint8_t OtaModeSts; //OTA ģʽ״̬ 0:not in ota 1:in transition ota 2:in ota
|
||||||
uint8_t BusoffCnt; //busoff计数器,进入busoff后每恢复一次就累加1。CAN总线正常后退出busoff就清零。
|
uint8_t BusoffCnt; //busoff计数器,进入busoff后每恢复一次就累加1。CAN总线正常后退出busoff就清零。
|
||||||
DTC_SnapshotType Snapshot;
|
DTC_SnapshotType Snapshot;
|
||||||
}VehicleInfo2UdsType;
|
}VehicleInfo2UdsType;
|
||||||
@ -66,6 +67,7 @@ typedef struct {
|
|||||||
uint16_t InsulDetVoltVal; // 绝缘检测电压 0.1V
|
uint16_t InsulDetVoltVal; // 绝缘检测电压 0.1V
|
||||||
uint8_t DTCNum; //DTC个数
|
uint8_t DTCNum; //DTC个数
|
||||||
uint8_t DTCList[DTC_ID_NUM];
|
uint8_t DTCList[DTC_ID_NUM];
|
||||||
|
uint8_t OtaModeSts; //OTA ģʽ״̬ 0:not in ota 1:in transition ota 2:in ota
|
||||||
}UdsInfo2VehicleType;
|
}UdsInfo2VehicleType;
|
||||||
|
|
||||||
|
|
||||||
|
BIN
UDS/uds_api.c
BIN
UDS/uds_api.c
Binary file not shown.
BIN
UDS/uds_api.h
BIN
UDS/uds_api.h
Binary file not shown.
BIN
UDS/uds_config.h
BIN
UDS/uds_config.h
Binary file not shown.
BIN
UDS/uds_did.h
BIN
UDS/uds_did.h
Binary file not shown.
@ -246,6 +246,7 @@ void GotoDefaultSession(void)
|
|||||||
//INT8U Tmp[10];
|
//INT8U Tmp[10];
|
||||||
static INT16U Timer1sCnt=0;
|
static INT16U Timer1sCnt=0;
|
||||||
static INT16U Timer10msCnt=0;
|
static INT16U Timer10msCnt=0;
|
||||||
|
// static INT16U Timer5minCnt=0;
|
||||||
|
|
||||||
//if(++Timer1sCnt >= 1000)
|
//if(++Timer1sCnt >= 1000)
|
||||||
if(++Timer10msCnt >= 10) {
|
if(++Timer10msCnt >= 10) {
|
||||||
@ -320,15 +321,25 @@ void GotoDefaultSession(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (UdsService.IsUdsFlg) {
|
if (UdsService.IsUdsFlg) {
|
||||||
udsInfo2Vehicle.UdsOffLine = false;
|
udsInfo2Vehicle.UdsOffLine = false;
|
||||||
} else {
|
} else {
|
||||||
udsInfo2Vehicle.UdsOffLine = true;
|
udsInfo2Vehicle.UdsOffLine = true;
|
||||||
|
udsInfo2Vehicle.OtaModeSts = 0;
|
||||||
#if BOOTLOADER_CODE_FLAG == 0
|
#if BOOTLOADER_CODE_FLAG == 0
|
||||||
IO_InputOutputRelease();
|
IO_InputOutputRelease();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (++Timer5minCnt >= 300) {
|
||||||
|
// Timer5minCnt = 0;
|
||||||
|
// if (UdsService.OtaTimeoutTimer) {
|
||||||
|
// UdsService.OtaTimeoutTimer--;
|
||||||
|
// }
|
||||||
|
// if (UdsService.OtaTimeoutTimer == 0) {
|
||||||
|
// udsInfo2Vehicle.OtaModeSts = 0;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -166,10 +166,13 @@ typedef struct{
|
|||||||
uint16_t IoDid;
|
uint16_t IoDid;
|
||||||
uint16_t Nrc78Timer;
|
uint16_t Nrc78Timer;
|
||||||
uint16_t ProgrammingPassTimer;
|
uint16_t ProgrammingPassTimer;
|
||||||
|
// uint8_t OtaTimeoutTimer; //5min
|
||||||
}__UDSService;
|
}__UDSService;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t SA_FailureCounter;
|
uint8_t SA_FailureCounter;
|
||||||
|
// uint8_t OtaModeSts;
|
||||||
|
// uint8_t OtaTimeoutTimer; //5min
|
||||||
uint8_t resever[7];
|
uint8_t resever[7];
|
||||||
uint8_t crc16[2];
|
uint8_t crc16[2];
|
||||||
}UDS_ParameterType;
|
}UDS_ParameterType;
|
||||||
|
BIN
UDS/uds_types.h
BIN
UDS/uds_types.h
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -1259,7 +1259,7 @@
|
|||||||
|
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>Sleep</GroupName>
|
<GroupName>Sleep</GroupName>
|
||||||
<tvExp>0</tvExp>
|
<tvExp>1</tvExp>
|
||||||
<tvExpOptDlg>0</tvExpOptDlg>
|
<tvExpOptDlg>0</tvExpOptDlg>
|
||||||
<cbSel>0</cbSel>
|
<cbSel>0</cbSel>
|
||||||
<RteFlg>0</RteFlg>
|
<RteFlg>0</RteFlg>
|
||||||
|
Loading…
Reference in New Issue
Block a user