初步修改
This commit is contained in:
parent
bbb01e5fed
commit
0d077efbc3
@ -245,7 +245,7 @@ FuncBootSeq = function(){
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var ret = FuncWait(0x28);
|
var ret = FuncWait(0x28);
|
||||||
nextstate(ret);
|
nextstate(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 6 {
|
case 6 {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,19 +1,119 @@
|
|||||||
QualityReport
|
QualityReport
|
||||||
2024年3月8日 11:32:24
|
2024年3月18日 0:23:52
|
||||||
|
|
||||||
------ Start build(ECU_APP, DefaultBuild) ------
|
------ Start build(ECU_APP, DefaultBuild) ------
|
||||||
------ Build ended(Error:0, Warning:0)(ECU_APP, DefaultBuild) ------
|
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\Bin\ccrl.exe diagnose\extern.c -cpu=S3 -obj_path=DefaultBuild "-dev=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF" -g -g_line -I diagnose\DTC -I diagnose\CanTrcv -I sys -I . -I rscan_driver -I diagnose -I DataFlash -I CanNw -I diagnose\CanTp -I diagnose\CanIf -I user -D DEBUG1 -c -msg_lang=english
|
||||||
|
diagnose\extern.c(99):W0520111:Statement is unreachable
|
||||||
|
diagnose\extern.c(128):W0520940:Missing return statement at end of non-void function "GetMotorLockStatus"
|
||||||
|
diagnose\extern.c(174):W0520111:Statement is unreachable
|
||||||
|
diagnose\extern.c(315):W0520111:Statement is unreachable
|
||||||
|
diagnose\extern.c(319):W0520111:Statement is unreachable
|
||||||
|
diagnose\extern.c(323):W0520111:Statement is unreachable
|
||||||
|
diagnose\extern.c(327):W0520111:Statement is unreachable
|
||||||
|
diagnose\extern.c(524):W0520940:Missing return statement at end of non-void function "GetBcmCommFault"
|
||||||
|
diagnose\extern.c(541):W0520940:Missing return statement at end of non-void function "GetAcpCommFault"
|
||||||
|
C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\Bin\rlink.exe -subcommand=DefaultBuild\ECU_APP.clnk
|
||||||
|
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
|
||||||
|
RAMDATA SECTION: 00000c5b Byte(s)
|
||||||
|
ROMDATA SECTION: 00000658 Byte(s)
|
||||||
|
PROGRAM SECTION: 00004fd6 Byte(s)
|
||||||
|
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
|
||||||
|
W0561017:The evaluation period of CC-RL V1 has expired. Please consider purchasing the product.
|
||||||
|
Renesas Optimizing Linker Completed
|
||||||
|
------ Build ended(Error:0, Warning:12)(ECU_APP, DefaultBuild) ------
|
||||||
|
|
||||||
|
--- CommandFile 1 ---
|
||||||
|
DefaultBuild\ECU_APP.clnk :
|
||||||
|
-Input=DefaultBuild\cstart.obj
|
||||||
|
-Input=DefaultBuild\stkinit.obj
|
||||||
|
-Input=DefaultBuild\r_pfdl.obj
|
||||||
|
-Input=DefaultBuild\RL78_RCAN.obj
|
||||||
|
-Input=DefaultBuild\r_rl78_can_drv.obj
|
||||||
|
-Input=DefaultBuild\r_rl78_can_irq.obj
|
||||||
|
-Input=DefaultBuild\r_systeminit.obj
|
||||||
|
-Input=DefaultBuild\r_main.obj
|
||||||
|
-Input=DefaultBuild\r_cg_wdt_user.obj
|
||||||
|
-Input=DefaultBuild\r_cg_wdt.obj
|
||||||
|
-Input=DefaultBuild\r_cg_timer_user.obj
|
||||||
|
-Input=DefaultBuild\r_cg_timer.obj
|
||||||
|
-Input=DefaultBuild\r_cg_port_user.obj
|
||||||
|
-Input=DefaultBuild\r_cg_port.obj
|
||||||
|
-Input=DefaultBuild\r_cg_cgc_user.obj
|
||||||
|
-Input=DefaultBuild\r_cg_cgc.obj
|
||||||
|
-Input=DefaultBuild\r_cg_adc_user.obj
|
||||||
|
-Input=DefaultBuild\r_cg_adc.obj
|
||||||
|
-Input=DefaultBuild\VectorTable.obj
|
||||||
|
-Input=DefaultBuild\CanNw.obj
|
||||||
|
-Input=DefaultBuild\CanNwConfig.obj
|
||||||
|
-Input=DefaultBuild\Dcm_App.obj
|
||||||
|
-Input=DefaultBuild\Dcm_App_Cfg.obj
|
||||||
|
-Input=DefaultBuild\Dcm_Cfg.obj
|
||||||
|
-Input=DefaultBuild\Dcm_DID.obj
|
||||||
|
-Input=DefaultBuild\Dcm_DID_Cfg.obj
|
||||||
|
-Input=DefaultBuild\Dcm_Key.obj
|
||||||
|
-Input=DefaultBuild\extern.obj
|
||||||
|
-Input=DefaultBuild\CanIf.obj
|
||||||
|
-Input=DefaultBuild\CanIf_Cfg.obj
|
||||||
|
-Input=DefaultBuild\CanTp_Cfg.obj
|
||||||
|
-Input=DefaultBuild\CanTrcv.obj
|
||||||
|
-Input=DefaultBuild\CanTrcv_Cfg.obj
|
||||||
|
-Input=DefaultBuild\DCM_DTC.obj
|
||||||
|
-Input=DefaultBuild\Dcm.obj
|
||||||
|
-Input=DefaultBuild\CanTp.obj
|
||||||
|
-Input=DefaultBuild\r_cg_intc.obj
|
||||||
|
-Input=DefaultBuild\r_cg_intc_user.obj
|
||||||
|
-Input=DefaultBuild\appTask.obj
|
||||||
|
-Input=DefaultBuild\can_user.obj
|
||||||
|
-Input=DefaultBuild\hwCtrl.obj
|
||||||
|
-LIBrary=DataFlash\pfdl.lib
|
||||||
|
-SECURITY_ID=00000000000000000000
|
||||||
|
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF
|
||||||
|
-DEBug
|
||||||
|
-NOCOmpress
|
||||||
|
-NOOPtimize
|
||||||
|
-OUtput=DefaultBuild\ECU_APP.abs
|
||||||
|
-LIBrary=C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\lib\rl78em4s.lib
|
||||||
|
-LIBrary=C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\lib\malloc_n.lib
|
||||||
|
-LIBrary=C:\Program Files (x86)\Renesas Electronics\CS+\CC\CC-RL\V1.11.00\lib\rl78em4r.lib
|
||||||
|
-OCDBG=04
|
||||||
|
-USER_OPT_BYTE=E933E8
|
||||||
|
-LISt=DefaultBuild\ECU_APP.map
|
||||||
|
-SHow=Reference,Xreference,Total_size,STRUCT
|
||||||
|
-STARt=VectorRemapingAddr_n,.const,.text,.RLIB,.SLIB,PFDL_COD,.textf,.constf,.data,.sdata/0A000,DID_TBL_f/19C00,KAM_SEG_n/FE500,.dataR,.bss/FE510,.sdataR,.sbss/FFE20
|
||||||
|
-ROm=.data=.dataR
|
||||||
|
-ROm=.sdata=.sdataR
|
||||||
|
-Message
|
||||||
|
-Total_size
|
||||||
|
-NOLOgo
|
||||||
|
-end
|
||||||
|
-Input=DefaultBuild\ECU_APP.abs
|
||||||
|
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF
|
||||||
|
-OUtput=DefaultBuild\ECU_APP.mot
|
||||||
|
-FOrm=Stype
|
||||||
|
-REcord=S3
|
||||||
|
-BYte_count=10
|
||||||
|
-Message
|
||||||
|
-end
|
||||||
|
-Input=DefaultBuild\ECU_APP.abs
|
||||||
|
-DEVICE=C:\Program Files (x86)\Renesas Electronics\CS+\CC\Device\RL78\Devicefile\DR5F10BBG.DVF
|
||||||
|
-OUtput=output\ECU_APP.S19= A000-19FFF
|
||||||
|
-FOrm=Stype
|
||||||
|
-REcord=S3
|
||||||
|
-SPace=FF
|
||||||
|
-BYte_count=10
|
||||||
|
-Message
|
||||||
|
-exit
|
||||||
|
|
||||||
|
|
||||||
--- SHA1 hash value of output files ---
|
--- SHA1 hash value of output files ---
|
||||||
F:\FCB_project\temp\CFMOTOR\code\ECU_APP\DefaultBuild\ECU_APP.abs: bd52c2ad8de9bdfb0e42ee4582de115cf1889b42
|
E:\workspace\CFMOTO\CFMOTOR\ECU_APP\DefaultBuild\ECU_APP.abs: 79450877dd5d24a71d9acbf1806f6b0d2977e672
|
||||||
F:\FCB_project\temp\CFMOTOR\code\ECU_APP\DefaultBuild\ECU_APP.mot: 0f0821526fddaf4871703c857fd6e97db69ee67a
|
E:\workspace\CFMOTO\CFMOTOR\ECU_APP\DefaultBuild\ECU_APP.mot: 7516e7665ffcc3b27ac3c251e43024c655f284db
|
||||||
F:\FCB_project\temp\CFMOTOR\code\ECU_APP\output\ECU_APP.S19: 6a33102150086edb949a8b2d0349dd897666c1e9
|
E:\workspace\CFMOTO\CFMOTOR\ECU_APP\output\ECU_APP.S19: fbe9346c325105244353b197acb3a83cc89d14cb
|
||||||
|
|
||||||
|
|
||||||
--- System Information ---
|
--- System Information ---
|
||||||
*OS Version
|
*OS Version
|
||||||
Microsoft Windows 10 专业版 (-, 10.0.19045, WOW64)
|
Microsoft Windows 11 专业版 (-, 10.0.22631, WOW64)
|
||||||
*Language
|
*Language
|
||||||
中文(中国)
|
中文(中国)
|
||||||
*.NET Framework Version
|
*.NET Framework Version
|
||||||
@ -33,16 +133,16 @@ F:\FCB_project\temp\CFMOTOR\code\ECU_APP\output\ECU_APP.S19: 6a33102150086edb949
|
|||||||
*Product License
|
*Product License
|
||||||
|
|
||||||
*Execution Place
|
*Execution Place
|
||||||
E:\Program Files (x86)\renesas\CS+\CC
|
C:\Program Files (x86)\Renesas Electronics\CS+\CC
|
||||||
*Memory Usage
|
*Memory Usage
|
||||||
*Private Working Set
|
*Private Working Set
|
||||||
323 MB
|
206 MB
|
||||||
*Number of GDI Objects
|
*Number of GDI Objects
|
||||||
2080
|
2138
|
||||||
*Number of USER Objects
|
*Number of USER Objects
|
||||||
1135
|
1194
|
||||||
*Opened Files
|
*Opened Files
|
||||||
2 editors, 2 files, 31 KB
|
4 editors, 4 files, 25 KB
|
||||||
|
|
||||||
--- Build Tool Plug-in Information ---
|
--- Build Tool Plug-in Information ---
|
||||||
RH850 Build tool CC-RH Plug-in
|
RH850 Build tool CC-RH Plug-in
|
||||||
@ -171,11 +271,11 @@ Device Information Common Interface
|
|||||||
DeviceInformation.dll
|
DeviceInformation.dll
|
||||||
|
|
||||||
--- Main Project Information ---
|
--- Main Project Information ---
|
||||||
F:\FCB_project\temp\CFMOTOR\code\ECU_APP\ECU_APP.mtpj
|
E:\workspace\CFMOTO\CFMOTOR\ECU_APP\ECU_APP.mtpj
|
||||||
Microcontroller Information
|
Microcontroller Information
|
||||||
*R5F10BBG
|
*R5F10BBG
|
||||||
*File Name: Version
|
*File Name: Version
|
||||||
RL78_Productlist.xml: V8.070000
|
RL78_Productlist.xml: V8.070100
|
||||||
R5F10BBG_common.xml: V1.13.00.XX.02
|
R5F10BBG_common.xml: V1.13.00.XX.02
|
||||||
DR5F10BBG.DVF: V1.11
|
DR5F10BBG.DVF: V1.11
|
||||||
f13_bbx.ti: V1.01
|
f13_bbx.ti: V1.01
|
||||||
|
@ -14,23 +14,17 @@
|
|||||||
#include "Dcm_extern.h"
|
#include "Dcm_extern.h"
|
||||||
|
|
||||||
const TsDcm_h_DtcGroupType CaDcm_u_DtcTable[DCM_SUPDTC_COUNT]={
|
const TsDcm_h_DtcGroupType CaDcm_u_DtcTable[DCM_SUPDTC_COUNT]={
|
||||||
{ 0,0xA8,0x80,0x16},
|
{ 0,0x91,0x17,0x16},//系统供电电压过低
|
||||||
{ 1,0xA8,0x80,0x17},
|
{ 1,0x91,0x17,0x17},//系统供电电压过高
|
||||||
{ 2,0xA8,0x80,0x88},
|
{ 2,0xC0,0x73,0x88},//BICAN总线BusOff
|
||||||
{ 3,0xA8,0x81,0x23},
|
{ 3,0xA8,0x81,0x23},//旋钮下压按键卡滞
|
||||||
{ 4,0xA8,0x82,0x23},
|
{ 4,0xA8,0x82,0x23},//旋钮上拨卡滞
|
||||||
{ 5,0xA8,0x83,0x23},
|
{ 5,0xA8,0x83,0x23},//旋钮下拨卡滞
|
||||||
{ 6,0xA8,0x84,0x23},
|
{ 6,0xA8,0x84,0x23},//旋钮左拨卡滞
|
||||||
{ 7,0xA8,0x85,0x23},
|
{ 7,0xA8,0x85,0x23},//旋钮右拨卡滞
|
||||||
{ 8,0xA8,0x86,0x25},
|
{ 8,0xA8,0x86,0x25},//旋钮光栅故障
|
||||||
{ 9,0xC1,0x00,0x87},
|
{ 9,0xC1,0x00,0x87},//ECM节点通信丢失
|
||||||
{10,0xD1,0x10,0x87},
|
{10,0xD1,0x10,0x87},//GBC节点通信丢失
|
||||||
{11,0xD2,0x06,0x82},
|
|
||||||
{12,0xD4,0x06,0x83},
|
|
||||||
{13,0xD2,0x0B,0x82},
|
|
||||||
{14,0xD4,0x0B,0x83},
|
|
||||||
{15,0xD2,0x14,0x82},
|
|
||||||
{16,0xD4,0x14,0x83}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -202,6 +196,28 @@ void ClearDtcStutas(uint8 DtcIndex)
|
|||||||
// DtcStutas[DtcIndex].DtcStutas &= ~(TestNotCompletedThisOperationCycle | TestFailed); //2017/7/2 11:52:29 del
|
// DtcStutas[DtcIndex].DtcStutas &= ~(TestNotCompletedThisOperationCycle | TestFailed); //2017/7/2 11:52:29 del
|
||||||
DtcStutas[DtcIndex].DtcStutas &= ~TestFailed; //2017/7/2 11:52:56 spark add
|
DtcStutas[DtcIndex].DtcStutas &= ~TestFailed; //2017/7/2 11:52:56 spark add
|
||||||
}
|
}
|
||||||
|
extern uint16_t ECM_lost_count,GBC_lost_count;
|
||||||
|
static void CanDTC_LostCommDetected(void)
|
||||||
|
{
|
||||||
|
if (ECM_lost_count == 0)
|
||||||
|
{
|
||||||
|
WriteDtcSnapshot(AC_ECM_LOST);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClearDtcStutas(AC_ECM_LOST);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GBC_lost_count == 0)
|
||||||
|
{
|
||||||
|
WriteDtcSnapshot(AC_GBC_LOST);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClearDtcStutas(AC_GBC_LOST);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static void CanDTC_AcBusOffDetected(void)
|
static void CanDTC_AcBusOffDetected(void)
|
||||||
{
|
{
|
||||||
@ -209,10 +225,14 @@ static void CanDTC_AcBusOffDetected(void)
|
|||||||
// uint32 DtcSnapshotRecord[32];
|
// uint32 DtcSnapshotRecord[32];
|
||||||
if(ChkNetDiagCondition() == 0) return;
|
if(ChkNetDiagCondition() == 0) return;
|
||||||
|
|
||||||
if(0!=GetCanBusOffErr()) {
|
if(0 != GetCanBusOffErr()) {
|
||||||
WriteDtcSnapshot(AC_BusOff);
|
WriteDtcSnapshot(AC_BusOff);
|
||||||
DtcStutas[AC_BusOff].DtcStutas &= ~TestFailed;
|
DtcStutas[AC_BusOff].DtcStutas &= ~TestFailed;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClearDtcStutas(AC_BusOff);
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if((BusOffCnt < 10) && (BusOffCnt > 0))
|
if((BusOffCnt < 10) && (BusOffCnt > 0))
|
||||||
@ -248,12 +268,12 @@ static void PowerVoltageChk(void)
|
|||||||
else
|
else
|
||||||
WriteDtcSnapshot(AC_OVER_VOLTAGE);
|
WriteDtcSnapshot(AC_OVER_VOLTAGE);
|
||||||
}
|
}
|
||||||
else
|
else if(GetVoltage(KL30_VOLTAGE) < 150)
|
||||||
{
|
{
|
||||||
if(PowerOverVoltCnt > 0){
|
if(PowerOverVoltCnt > 0){
|
||||||
PowerOverVoltCnt--;
|
PowerOverVoltCnt--;
|
||||||
if(PowerOverVoltCnt>37){ /* 37*40ms = 1.48s */
|
if(PowerOverVoltCnt>13){ /* 13*40ms = 520ms */
|
||||||
PowerOverVoltCnt = 37;
|
PowerOverVoltCnt = 12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@ -268,12 +288,12 @@ static void PowerVoltageChk(void)
|
|||||||
else
|
else
|
||||||
WriteDtcSnapshot(AC_LOW_VOLTAGE);
|
WriteDtcSnapshot(AC_LOW_VOLTAGE);
|
||||||
}
|
}
|
||||||
else
|
else if(GetVoltage(KL30_VOLTAGE) > 100)
|
||||||
{
|
{
|
||||||
if(PowerUderVoltCnt > 0){
|
if(PowerUderVoltCnt > 0){
|
||||||
PowerUderVoltCnt--;
|
PowerUderVoltCnt--;
|
||||||
if(PowerUderVoltCnt>37){ /* 37*40ms = 1.48s */
|
if(PowerUderVoltCnt>13){ /* 13*40ms = 1.48s */
|
||||||
PowerUderVoltCnt = 37;
|
PowerUderVoltCnt = 12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -542,7 +562,7 @@ void CanDTC_Task(void)
|
|||||||
//CanDTC_CanCommunicationLostDetected(COMP_Information_ID);
|
//CanDTC_CanCommunicationLostDetected(COMP_Information_ID);
|
||||||
//CanDTC_CompErrChk();
|
//CanDTC_CompErrChk();
|
||||||
//CanDTC_MotorRunTimeChk();
|
//CanDTC_MotorRunTimeChk();
|
||||||
|
CanDTC_LostCommDetected();
|
||||||
//MotorLockChk();
|
//MotorLockChk();
|
||||||
|
|
||||||
if(DtcTestCycleTim < DTC_TEST_CYCLE_TIM)
|
if(DtcTestCycleTim < DTC_TEST_CYCLE_TIM)
|
||||||
|
@ -7,12 +7,12 @@
|
|||||||
|
|
||||||
|
|
||||||
#define DCM_19SUPDTCEXTDATARECORD_COUNT (4U)
|
#define DCM_19SUPDTCEXTDATARECORD_COUNT (4U)
|
||||||
/* 19 06֧<EFBFBD>ֵ<EFBFBD>DTCExtDataRecord <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* 19 06????DTCExtDataRecord ???????? */
|
||||||
#define DCM_SUPDTC_COUNT ( 17U )
|
#define DCM_SUPDTC_COUNT ( 11U )
|
||||||
/* <EFBFBD><EFBFBD>Ʒ֧<EFBFBD>ֵ<EFBFBD>DTC<EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* ???????DTC???? */
|
||||||
|
|
||||||
|
|
||||||
#define DTC_TEST_CYCLE_TIM 40U // 40mSһ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
#define DTC_TEST_CYCLE_TIM 40U // 40mS???????
|
||||||
|
|
||||||
#define ISO_15031_6_DTC_FORMAT 0U
|
#define ISO_15031_6_DTC_FORMAT 0U
|
||||||
#define ISO_14229_1_DTC_FORMAT 1U
|
#define ISO_14229_1_DTC_FORMAT 1U
|
||||||
@ -21,19 +21,19 @@
|
|||||||
#define DTC_STATUS_AVAILABILITY_MASK 0x09U
|
#define DTC_STATUS_AVAILABILITY_MASK 0x09U
|
||||||
|
|
||||||
typedef uint8 (*ReportDTCExtDataFun)(uint8* LeDemDtcNum,uint8 LeDemParameter,uint8* LeDemDataRecord);
|
typedef uint8 (*ReportDTCExtDataFun)(uint8* LeDemDtcNum,uint8 LeDemParameter,uint8* LeDemDataRecord);
|
||||||
/*19 06 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD> DTCExtDataRecordNumber <20>б<EFBFBD><D0B1>ṹ<EFBFBD><E1B9B9>*/
|
/*19 06 ???????? DTCExtDataRecordNumber ?<3F><>?????*/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint8 DTCExtDataRecordNumber; /*<EFBFBD><EFBFBD>չ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>number*/
|
uint8 DTCExtDataRecordNumber; /*???????number*/
|
||||||
ReportDTCExtDataFun Function; /*<EFBFBD><EFBFBD>չ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>number <20><>Ӧ<EFBFBD><D3A6><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
|
ReportDTCExtDataFun Function; /*???????number ????????????????*/
|
||||||
}DTCExtDataRecordType;
|
}DTCExtDataRecordType;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint8 DtcIndex;
|
uint8 DtcIndex;
|
||||||
uint8 DtcHigh; /*DTC <EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD>*/
|
uint8 DtcHigh; /*DTC ?????*/
|
||||||
uint8 DtcMiddle; /*DTC <EFBFBD>м<EFBFBD><EFBFBD>ֽ<EFBFBD>*/
|
uint8 DtcMiddle; /*DTC ?<3F><>????*/
|
||||||
uint8 DtcLow; /*DTC <EFBFBD><EFBFBD><EFBFBD>ֽ<EFBFBD>*/
|
uint8 DtcLow; /*DTC ?????*/
|
||||||
}TsDcm_h_DtcGroupType;
|
}TsDcm_h_DtcGroupType;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
@ -93,7 +93,16 @@ extern DtcStutas_T DtcStutas[DCM_SUPDTC_COUNT];
|
|||||||
|
|
||||||
#define AC_LOW_VOLTAGE 0
|
#define AC_LOW_VOLTAGE 0
|
||||||
#define AC_OVER_VOLTAGE 1
|
#define AC_OVER_VOLTAGE 1
|
||||||
#define AC_BusOff 3
|
#define AC_BusOff 2
|
||||||
|
#define AC_KEY_OK_STICK 3
|
||||||
|
#define AC_KEY_UP_STICK 4
|
||||||
|
#define AC_KEY_DOWN_STICK 5
|
||||||
|
#define AC_KEY_LEFT_STICK 6
|
||||||
|
#define AC_KEY_RIGHT_STICK 7
|
||||||
|
#define AC_KEY_GRID_STICK 8
|
||||||
|
#define AC_ECM_LOST 9
|
||||||
|
#define AC_GBC_LOST 10
|
||||||
|
|
||||||
|
|
||||||
#define AC_TEMP_MOTOR_SHORT_CUT_TO_VCC 2
|
#define AC_TEMP_MOTOR_SHORT_CUT_TO_VCC 2
|
||||||
#define AC_TEMP_MOTOR_SHORT_CUT_TO_GND 3
|
#define AC_TEMP_MOTOR_SHORT_CUT_TO_GND 3
|
||||||
|
@ -560,7 +560,7 @@ TeDcm_h_ResultType MngDcm_SoftResetDeal(void)
|
|||||||
{
|
{
|
||||||
SaDcm_u_RequestCounter++;
|
SaDcm_u_RequestCounter++;
|
||||||
KamData.SeedReqTimes = SaDcm_u_RequestCounter | 0x10;
|
KamData.SeedReqTimes = SaDcm_u_RequestCounter | 0x10;
|
||||||
if(SaDcm_u_RequestCounter == 3)
|
if(SaDcm_u_RequestCounter == 4)
|
||||||
{
|
{
|
||||||
SaDcm_u_RequestDelayCount = DCM_SASERVERSTS_ERRORDELAY_COUNT;
|
SaDcm_u_RequestDelayCount = DCM_SASERVERSTS_ERRORDELAY_COUNT;
|
||||||
SeDcm_u_KeyErrorCount = 3;
|
SeDcm_u_KeyErrorCount = 3;
|
||||||
@ -585,10 +585,10 @@ TeDcm_h_ResultType MngDcm_SoftResetDeal(void)
|
|||||||
SaDcm_u_RequestCounter=0;
|
SaDcm_u_RequestCounter=0;
|
||||||
KamData.SeedReqTimes = 0;
|
KamData.SeedReqTimes = 0;
|
||||||
|
|
||||||
ReadFlashData(savebuf,0x000F1800,4);
|
//ReadFlashData(savebuf,0x000F1800,4);
|
||||||
savebuf[0] = SaDcm_u_RequestCounter;
|
savebuf[0] = SaDcm_u_RequestCounter;
|
||||||
savebuf[1] = SeDcm_u_KeyErrorCount;
|
savebuf[1] = SeDcm_u_KeyErrorCount;
|
||||||
WriteDataflash(savebuf,0x000F1800,4);
|
//WriteDataflash(savebuf,0x000F1800,4);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1754,10 +1754,10 @@ void MngDcmKeyErrorDelayCountCutDown(void)
|
|||||||
{
|
{
|
||||||
SeDcm_u_KeyErrorCount = 0U;
|
SeDcm_u_KeyErrorCount = 0U;
|
||||||
KamData.KeyErrTimes = SeDcm_u_KeyErrorCount;
|
KamData.KeyErrTimes = SeDcm_u_KeyErrorCount;
|
||||||
ReadFlashData(savebuf,0x000F1800,4);
|
//ReadFlashData(savebuf,0x000F1800,4);
|
||||||
savebuf[0] = SaDcm_u_RequestCounter;
|
savebuf[0] = SaDcm_u_RequestCounter;
|
||||||
savebuf[1] = SeDcm_u_KeyErrorCount;
|
savebuf[1] = SeDcm_u_KeyErrorCount;
|
||||||
WriteDataflash(savebuf,0x000F1800,4);
|
//WriteDataflash(savebuf,0x000F1800,4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(SaDcm_u_RequestDelayCount > 0)
|
if(SaDcm_u_RequestDelayCount > 0)
|
||||||
@ -1767,10 +1767,10 @@ void MngDcmKeyErrorDelayCountCutDown(void)
|
|||||||
{
|
{
|
||||||
SaDcm_u_RequestCounter = 0U;
|
SaDcm_u_RequestCounter = 0U;
|
||||||
KamData.SeedReqTimes = SaDcm_u_RequestCounter;
|
KamData.SeedReqTimes = SaDcm_u_RequestCounter;
|
||||||
ReadFlashData(savebuf,0x000F1800,4);
|
//ReadFlashData(savebuf,0x000F1800,4);
|
||||||
savebuf[0] = SaDcm_u_RequestCounter;
|
savebuf[0] = SaDcm_u_RequestCounter;
|
||||||
savebuf[1] = SeDcm_u_KeyErrorCount;
|
savebuf[1] = SeDcm_u_KeyErrorCount;
|
||||||
WriteDataflash(savebuf,0x000F1800,4);
|
//WriteDataflash(savebuf,0x000F1800,4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2094,8 +2094,8 @@ TeDcm_h_ResultType MngDcm_TransmitExitService(void)
|
|||||||
//SeDcm_u_KeyErrorCount = KamData.KeyErrTimes; /*¶ÁÈ¡´¢´æµÄ´ÎÊý*/
|
//SeDcm_u_KeyErrorCount = KamData.KeyErrTimes; /*¶ÁÈ¡´¢´æµÄ´ÎÊý*/
|
||||||
ReadFlashData(readbuf,0x000F1800,4);
|
ReadFlashData(readbuf,0x000F1800,4);
|
||||||
|
|
||||||
SaDcm_u_RequestCounter = readbuf[0];
|
SaDcm_u_RequestCounter = 0;//readbuf[0];
|
||||||
SeDcm_u_KeyErrorCount = readbuf[1]; /*读取储存的次数*/
|
SeDcm_u_KeyErrorCount = 0;//readbuf[1]; /*读取储存的次数*/
|
||||||
|
|
||||||
if(SaDcm_u_RequestCounter > 6)SaDcm_u_RequestCounter=0;
|
if(SaDcm_u_RequestCounter > 6)SaDcm_u_RequestCounter=0;
|
||||||
if(SeDcm_u_KeyErrorCount > 4)SeDcm_u_KeyErrorCount=0;
|
if(SeDcm_u_KeyErrorCount > 4)SeDcm_u_KeyErrorCount=0;
|
||||||
|
@ -69,8 +69,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define DCM_SASERVERSTS_ERRORDELAY_COUNT 10000U /*密钥错误延时*/
|
#define DCM_SASERVERSTS_ERRORDELAY_COUNT 9000U /*密钥错误延时*/
|
||||||
#define DCM_SASERVERSTS_ERRORDELAY_COUNT_DEFAULT 10000U /*密钥错误延时 上电默认值*/
|
#define DCM_SASERVERSTS_ERRORDELAY_COUNT_DEFAULT 9000U /*密钥错误延时 上电默认值*/
|
||||||
|
|
||||||
#define DCM_S3SEVERTIMEOUT 5000U /*S3ServerTime计时超时计数量标定*/
|
#define DCM_S3SEVERTIMEOUT 5000U /*S3ServerTime计时超时计数量标定*/
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ __far const unsigned char SW_VERSION[]={
|
|||||||
'1' , //AC_SW_VERSION_06
|
'1' , //AC_SW_VERSION_06
|
||||||
'.' , //AC_SW_VERSION_07
|
'.' , //AC_SW_VERSION_07
|
||||||
'0' , //AC_SW_VERSION_08
|
'0' , //AC_SW_VERSION_08
|
||||||
'4' , //AC_SW_VERSION_09
|
'5' , //AC_SW_VERSION_09
|
||||||
' ' , //AC_SW_VERSION_10
|
' ' , //AC_SW_VERSION_10
|
||||||
' ' , //AC_SW_VERSION_11
|
' ' , //AC_SW_VERSION_11
|
||||||
' ' , //AC_SW_VERSION_12
|
' ' , //AC_SW_VERSION_12
|
||||||
@ -74,36 +74,29 @@ const unsigned char DID_0xF198_RepairShopCodeOrTesterSerialNumber[16]={0x20,0x20
|
|||||||
const unsigned char DID_0xF199_ProgrammingOrConfigurationDate[4]={0x20,0x00,0x01,0x01};
|
const unsigned char DID_0xF199_ProgrammingOrConfigurationDate[4]={0x20,0x00,0x01,0x01};
|
||||||
const unsigned char DID_0xF19D_ECUInstallationDateDataIdentifier[4]={0x20,0x00,0x01,0x01};
|
const unsigned char DID_0xF19D_ECUInstallationDateDataIdentifier[4]={0x20,0x00,0x01,0x01};
|
||||||
const unsigned char DID_0xF112_VehicleName[8]={0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20};
|
const unsigned char DID_0xF112_VehicleName[8]={0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20};
|
||||||
can_frame_t TxCanMessageT;
|
can_frame_t TxCanMessageT;
|
||||||
|
|
||||||
|
extern uint16_t SupplyVoltage;
|
||||||
|
|
||||||
//const unsigned char DID_0xF15A[]={};
|
//const unsigned char DID_0xF15A[]={};
|
||||||
/****************************************************************************************/
|
/****************************************************************************************/
|
||||||
/* 输入参数 ch : */
|
|
||||||
/* 0: 压缩机温<E69CBA>?? */
|
|
||||||
/* 1: 室<>?<3F>温<EFBFBD>?? */
|
|
||||||
/* 2: 室内温度 */
|
|
||||||
/* 返回值: */
|
|
||||||
/* 对应的电<E79A84>??*10(即返回的电压值精度是0.1V的) */
|
|
||||||
/* */
|
|
||||||
|
|
||||||
unsigned char GetVoltage(unsigned char ch)
|
unsigned char GetVoltage(unsigned char ch)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* 这里<E8BF99>??以做数组的方式返回,但尽量不要在这里计算,例如下 return Voltage[ch]; */
|
switch (ch)
|
||||||
// switch(ch)
|
{
|
||||||
// {
|
case KL30_VOLTAGE:
|
||||||
// case EVA_SENSOR:
|
if (SupplyVoltage > 0xff)
|
||||||
// return uiDuctAdVal;
|
{
|
||||||
// break;
|
return 0xff;
|
||||||
// case OUTSIDE_SENSOR:
|
}
|
||||||
// return uiAmbAdVal;
|
return SupplyVoltage;
|
||||||
// break;
|
|
||||||
// case INSIDE_SENSOR:
|
default:
|
||||||
// return uiIncarAdVal;
|
return 0;
|
||||||
// break;
|
}
|
||||||
// default:
|
return 0;
|
||||||
// return 0;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************/
|
/************************************************************************************/
|
||||||
@ -597,7 +590,7 @@ void getOutputState(unsigned char* data)
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
extern uint16_t SupplyVoltage;
|
|
||||||
void getSupplyVoltage(unsigned char* data)
|
void getSupplyVoltage(unsigned char* data)
|
||||||
{
|
{
|
||||||
data[0] = SupplyVoltage;
|
data[0] = SupplyVoltage;
|
||||||
|
@ -71,7 +71,7 @@ void R_ADC_Create(void)
|
|||||||
ADM2 = _00_AD_POSITIVE_VDD | _00_AD_NEGATIVE_VSS | _00_AD_AREA_MODE_1 | _00_AD_RESOLUTION_10BIT;
|
ADM2 = _00_AD_POSITIVE_VDD | _00_AD_NEGATIVE_VSS | _00_AD_AREA_MODE_1 | _00_AD_RESOLUTION_10BIT;
|
||||||
ADUL = _FF_AD_ADUL_VALUE;
|
ADUL = _FF_AD_ADUL_VALUE;
|
||||||
ADLL = _00_AD_ADLL_VALUE;
|
ADLL = _00_AD_ADLL_VALUE;
|
||||||
ADS = _04_AD_INPUT_CHANNEL_4;
|
ADS = _04_AD_INPUT_CHANNEL_4;//_00_AD_INPUT_CHANNEL_0;
|
||||||
ADCE = 1U; /* enable AD comparator */
|
ADCE = 1U; /* enable AD comparator */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,8 @@ const uint16_t g_rxrule_table[CAN_RX_RULE_NUM][6] = {
|
|||||||
{ 0x0403U, 0x0000U, 0xFFFFU, 0xDFFFU, 0x8202U, 0x8003U },
|
{ 0x0403U, 0x0000U, 0xFFFFU, 0xDFFFU, 0x8202U, 0x8003U },
|
||||||
{ 0x026DU, 0x0000U, 0xFFFFU, 0xDFFFU, 0x8302U, 0x8004U },
|
{ 0x026DU, 0x0000U, 0xFFFFU, 0xDFFFU, 0x8302U, 0x8004U },
|
||||||
{ 0x0400U, 0x0000U, 0x0000U, 0xD480U, 0x8402U, 0x8005U }, //NW PDU
|
{ 0x0400U, 0x0000U, 0x0000U, 0xD480U, 0x8402U, 0x8005U }, //NW PDU
|
||||||
|
{ 0x0108U, 0x0000U, 0xFFFFU, 0xDFFFU, 0x8502U, 0x8006U }, //ECM
|
||||||
|
{ 0x0129U, 0x0000U, 0xFFFFU, 0xDFFFU, 0x8602U, 0x8007U }, //GBC
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
#define CAN_CFG_DLC_ERROR_IE CAN_ENABLE
|
#define CAN_CFG_DLC_ERROR_IE CAN_ENABLE
|
||||||
|
|
||||||
/* ---- Rx rule ---- */
|
/* ---- Rx rule ---- */
|
||||||
#define CAN_RX_RULE_NUM_CH0 (5U)
|
#define CAN_RX_RULE_NUM_CH0 (7U)
|
||||||
#define CAN_RX_RULE_NUM CAN_RX_RULE_NUM_CH0
|
#define CAN_RX_RULE_NUM CAN_RX_RULE_NUM_CH0
|
||||||
|
|
||||||
/* ---- Rx buffer ---- */
|
/* ---- Rx buffer ---- */
|
||||||
|
@ -69,7 +69,7 @@ unsigned char CAN_data_buf[8];
|
|||||||
void __near RSCAN_INTCANGERR_interrupt(void)
|
void __near RSCAN_INTCANGERR_interrupt(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
extern uint16_t ECM_lost_count,GBC_lost_count;
|
||||||
/*CAN global reveive FIFO*/
|
/*CAN global reveive FIFO*/
|
||||||
void __near RSCAN_INTCANGRECC_interrupt(void)
|
void __near RSCAN_INTCANGRECC_interrupt(void)
|
||||||
{
|
{
|
||||||
@ -110,6 +110,20 @@ void __near RSCAN_INTCANGRECC_interrupt(void)
|
|||||||
//Copy_Array_to_Array(CAN_26D.Msg_Byte, RxCanMessage.DB, 8);
|
//Copy_Array_to_Array(CAN_26D.Msg_Byte, RxCanMessage.DB, 8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (RxCanMessage.IDL == 0x0108)
|
||||||
|
{
|
||||||
|
if (App28sTxRxStatus & 0x02 != 0) // Rx enable
|
||||||
|
{
|
||||||
|
ECM_lost_count = 500; // 500mS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (RxCanMessage.IDL == 0x0129)
|
||||||
|
{
|
||||||
|
if (App28sTxRxStatus & 0x02 != 0) // Rx enable
|
||||||
|
{
|
||||||
|
GBC_lost_count = 500; // 500mS
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*CAN0 channel error*/
|
/*CAN0 channel error*/
|
||||||
|
@ -613,7 +613,7 @@ void IGN_Voltage_Detect(void)
|
|||||||
{
|
{
|
||||||
uint32_t adval;
|
uint32_t adval;
|
||||||
adval = getAdval(ADCH_IGN);
|
adval = getAdval(ADCH_IGN);
|
||||||
SupplyVoltage = (adval*57*5)>>10;
|
SupplyVoltage = (adval*57*5)>>10 + 7;
|
||||||
if (adval <= 305 )
|
if (adval <= 305 )
|
||||||
{
|
{
|
||||||
IGN_Voltage_error_count++;
|
IGN_Voltage_error_count++;
|
||||||
@ -649,7 +649,7 @@ void IGN_Voltage_Detect(void)
|
|||||||
void value_init(void)
|
void value_init(void)
|
||||||
{
|
{
|
||||||
CAN_LostCount = 500;
|
CAN_LostCount = 500;
|
||||||
BusOff_Detect_delay_count = 1000;
|
BusOff_Detect_delay_count = 500;
|
||||||
ucIgnStus = IGN_OFF;
|
ucIgnStus = IGN_OFF;
|
||||||
}
|
}
|
||||||
void CAN_RX_Data_Handle(void)
|
void CAN_RX_Data_Handle(void)
|
||||||
|
@ -40,7 +40,7 @@ extern uint16_t g_adval[12];
|
|||||||
|
|
||||||
extern uint16_t ZYMotorLocation;
|
extern uint16_t ZYMotorLocation;
|
||||||
extern uint16_t KBMotorLocation;
|
extern uint16_t KBMotorLocation;
|
||||||
|
uint16_t ECM_lost_count,GBC_lost_count;
|
||||||
void Copy_Array_to_Array(unsigned char *dest, unsigned char *src, unsigned char count)
|
void Copy_Array_to_Array(unsigned char *dest, unsigned char *src, unsigned char count)
|
||||||
{
|
{
|
||||||
unsigned char i = 0;
|
unsigned char i = 0;
|
||||||
@ -69,10 +69,13 @@ void CAN_TX_MESSAGE_INIT(void)
|
|||||||
TxCanMessage.LBL = 0; /* Label Data */
|
TxCanMessage.LBL = 0; /* Label Data */
|
||||||
TxCanMessage.TS = 0; /* Timestamp Data */
|
TxCanMessage.TS = 0; /* Timestamp Data */
|
||||||
Can_Msg_Change_Bcm();
|
Can_Msg_Change_Bcm();
|
||||||
|
GBC_lost_count = 1000;
|
||||||
|
ECM_lost_count = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
//extern uint8_t flagOverCurrentKB,flagOverCurrentZY;
|
//extern uint8_t flagOverCurrentKB,flagOverCurrentZY;
|
||||||
uint8_t txbuf1[8],txbuf2[8],txbuf3[8];
|
uint8_t txbuf1[8],txbuf2[8],txbuf3[8];
|
||||||
|
extern uint16_t SupplyVoltage;
|
||||||
void TxTestMsg(void)
|
void TxTestMsg(void)
|
||||||
{
|
{
|
||||||
uint8_t testdata[8] = {0};
|
uint8_t testdata[8] = {0};
|
||||||
@ -80,6 +83,10 @@ void TxTestMsg(void)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
testdata[0] = SupplyVoltage>>8;
|
||||||
|
testdata[1] = SupplyVoltage;
|
||||||
|
testdata[2] = ECM_lost_count>0?1:0;
|
||||||
|
testdata[3] = GBC_lost_count>0?1:0;
|
||||||
TransmitCAN_Message(0x333,8,testdata);
|
TransmitCAN_Message(0x333,8,testdata);
|
||||||
}
|
}
|
||||||
//立即发送
|
//立即发送
|
||||||
@ -89,11 +96,26 @@ void ClearTxCounter(void)
|
|||||||
air_req_timer = 0;
|
air_req_timer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CommunicationLostDetected(void)
|
||||||
|
{
|
||||||
|
if (App28sTxRxStatus & 0x02 != 0) // Rx enable
|
||||||
|
{
|
||||||
|
if (ECM_lost_count > 0)
|
||||||
|
{
|
||||||
|
ECM_lost_count--;
|
||||||
|
}
|
||||||
|
if (GBC_lost_count > 0)
|
||||||
|
{
|
||||||
|
GBC_lost_count--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TxServe(void)
|
void TxServe(void)
|
||||||
{
|
{
|
||||||
Can_RtnType re_flag;
|
Can_RtnType re_flag;
|
||||||
static unsigned char sucNwSendCnt = 0;
|
static unsigned char sucNwSendCnt = 0;
|
||||||
|
CommunicationLostDetected();
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
if ((ucNwSendPduType == SEND_NWAPP_PDU) || (ucNwSendPduType == SEND_APP_PDU))
|
if ((ucNwSendPduType == SEND_NWAPP_PDU) || (ucNwSendPduType == SEND_APP_PDU))
|
||||||
{
|
{
|
||||||
@ -141,6 +163,8 @@ void TxServe(void)
|
|||||||
Can_Msg_Change_Bcm();
|
Can_Msg_Change_Bcm();
|
||||||
re_flag = R_CAN_TrmByTRFIFO0_CH0(&TxCanMessage);
|
re_flag = R_CAN_TrmByTRFIFO0_CH0(&TxCanMessage);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//TxTestMsg();
|
//TxTestMsg();
|
||||||
air_req_timer = C_100MS_1MS;
|
air_req_timer = C_100MS_1MS;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user