Commit f3e1cac1 authored by hu's avatar hu

调整EEP存储

parent 59cfa7f1
......@@ -140,8 +140,8 @@ void GUI_Display_Value_Init(void)
/*应用*/
User_App.User_Language = 1u ;
User_App.User_Company = 1u ;
User_App.User_Light1 = K_Line_Set.ReservedB ;
User_App.User_Light2 = K_Line_Set.ReservedB ;
User_App.User_Light1 = 10u ;
User_App.User_Light2 = 10u ;
User_App.Trip_Type = 0u;
/*保养状态标识*/
......
......@@ -36,7 +36,6 @@ unsigned char Recvseed4;
unsigned char Seed1, Seed2, Seed3, Seed4;
_NVMNODIGIT NVMNODIGIT;
_ECUStatus ECUStatusONE;
unsigned char DTCstatusCHGFFK_Line;
......@@ -196,16 +195,16 @@ unsigned char kwp_readEcuIdentification(unsigned char *TxData, unsigned char *Re
case 0x91: /* vehicleManufacturerECUHardwareNumber */
(*TxData++) = KWP2000_READECUIDENTIFICATION_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = RequestData[0]; // ISUZU Parts No. 8979683010
(*TxData++) = NVMNODIGIT.No_Digit1;
(*TxData++) = NVMNODIGIT.No_Digit2;
(*TxData++) = NVMNODIGIT.No_Digit3;
(*TxData++) = NVMNODIGIT.No_Digit4;
(*TxData++) = NVMNODIGIT.No_Digit5;
(*TxData++) = NVMNODIGIT.No_Digit6;
(*TxData++) = NVMNODIGIT.No_Digit7;
(*TxData++) = NVMNODIGIT.No_Digit8;
(*TxData++) = NVMNODIGIT.No_Digit9;
(*TxData++) = NVMNODIGIT.No_Digit10;
(*TxData++) = K_Line_Set.No_Digit1;
(*TxData++) = K_Line_Set.No_Digit2;
(*TxData++) = K_Line_Set.No_Digit3;
(*TxData++) = K_Line_Set.No_Digit4;
(*TxData++) = K_Line_Set.No_Digit5;
(*TxData++) = K_Line_Set.No_Digit6;
(*TxData++) = K_Line_Set.No_Digit7;
(*TxData++) = K_Line_Set.No_Digit8;
(*TxData++) = K_Line_Set.No_Digit9;
(*TxData++) = K_Line_Set.No_Digit10;
Tx_Len = 12;
break;
default: /* subFunctionNotSupported */
......@@ -594,16 +593,16 @@ unsigned char kwp_writeDataByLocalIdentifier(unsigned char *TxData, unsigned cha
break;
case 0x91: /* */
NVMNODIGIT.No_Digit1 = RequestData[1];
NVMNODIGIT.No_Digit2 = RequestData[2];
NVMNODIGIT.No_Digit3 = RequestData[3];
NVMNODIGIT.No_Digit4 = RequestData[4];
NVMNODIGIT.No_Digit5 = RequestData[5];
NVMNODIGIT.No_Digit6 = RequestData[6];
NVMNODIGIT.No_Digit7 = RequestData[7];
NVMNODIGIT.No_Digit8 = RequestData[8];
NVMNODIGIT.No_Digit9 = RequestData[9];
NVMNODIGIT.No_Digit10 = RequestData[10];
K_Line_Set.No_Digit1 = RequestData[1];
K_Line_Set.No_Digit2 = RequestData[2];
K_Line_Set.No_Digit3 = RequestData[3];
K_Line_Set.No_Digit4 = RequestData[4];
K_Line_Set.No_Digit5 = RequestData[5];
K_Line_Set.No_Digit6 = RequestData[6];
K_Line_Set.No_Digit7 = RequestData[7];
K_Line_Set.No_Digit8 = RequestData[8];
K_Line_Set.No_Digit9 = RequestData[9];
K_Line_Set.No_Digit10 = RequestData[10];
/*写EEP*/
// NVM_Data_Update(NVM_NO_DIGIT); //----ECU ID_ECU件号 eep
......@@ -613,17 +612,17 @@ unsigned char kwp_writeDataByLocalIdentifier(unsigned char *TxData, unsigned cha
Tx_Len = 2;
break;
case 0xA0: /* */
NVMNODIGIT.TesterECU = RequestData[2];
K_Line_Set.TesterECU = RequestData[2];
if (NVMNODIGIT.METERCOUNT < 0xFF)
if (K_Line_Set.METERCOUNT < 0xFF)
{
NVMNODIGIT.METERCOUNT++; /*修正率次数增加*/
K_Line_Set.METERCOUNT++; /*修正率次数增加*/
/*写EEP*/
// NVM_Data_Update(NVM_NO_DIGIT);
}
else
{
NVMNODIGIT.METERCOUNT = 0xFF; /*修正率次数增加*/
K_Line_Set.METERCOUNT = 0xFF; /*修正率次数增加*/
/*写EEP*/
// NVM_Data_Update(NVM_NO_DIGIT);
}
......@@ -633,17 +632,17 @@ unsigned char kwp_writeDataByLocalIdentifier(unsigned char *TxData, unsigned cha
Tx_Len = 2;
break;
case 0xA3: /* */
NVMNODIGIT.TesterECUCAN = RequestData[2];
K_Line_Set.TesterECUCAN = RequestData[2];
if (NVMNODIGIT.METERCOUNT < 0xFF)
if (K_Line_Set.METERCOUNT < 0xFF)
{
NVMNODIGIT.METERCOUNT++; /*修正率次数增加*/
K_Line_Set.METERCOUNT++; /*修正率次数增加*/
/*写EEP*/
// NVM_Data_Update(NVM_NO_DIGIT);
}
else
{
NVMNODIGIT.METERCOUNT = 0xFF; /*修正率次数增加*/
K_Line_Set.METERCOUNT = 0xFF; /*修正率次数增加*/
/*写EEP*/
// NVM_Data_Update(NVM_NO_DIGIT);
}
......@@ -1049,43 +1048,43 @@ unsigned char kwp_readDataByLocalIdentifier(unsigned char *TxData, unsigned char
(*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = 0xA0;
(*TxData++) = 0x00;
(*TxData++) = NVMNODIGIT.TesterECU;
(*TxData++) = K_Line_Set.TesterECU;
Tx_Len = 4;
break;
case 0xA3: /* */
(*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = 0xA3;
(*TxData++) = 0x00;
(*TxData++) = NVMNODIGIT.TesterECUCAN;
(*TxData++) = K_Line_Set.TesterECUCAN;
Tx_Len = 4;
break;
case 0xA1: /* */
/*
NVMNODIGIT.ECUStatus1 = ECUStatusONE.Data[0];
K_Line_Set.ECUStatus1 = ECUStatusONE.Data[0];
if (DataVSpeedDisp <= 1275)
NVMNODIGIT.ECUStatus2 = DataVSpeedDisp / 5 ;
K_Line_Set.ECUStatus2 = DataVSpeedDisp / 5 ;
ECUStatusCup = ECUSTATUST_F ;
NVMNODIGIT.ECUStatus3 = (unsigned char)(ECUStatusCup & 0xFF);
NVMNODIGIT.ECUStatus4 = (unsigned char)((ECUStatusCup >> 8) & 0xFF);
K_Line_Set.ECUStatus3 = (unsigned char)(ECUStatusCup & 0xFF);
K_Line_Set.ECUStatus4 = (unsigned char)((ECUStatusCup >> 8) & 0xFF);
NVMNODIGIT.ECUStatus5 = 0x80;
K_Line_Set.ECUStatus5 = 0x80;
(*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = 0xA1;
(*TxData++) = NVMNODIGIT.ECUStatus1;
(*TxData++) = NVMNODIGIT.ECUStatus2;
(*TxData++) = NVMNODIGIT.ECUStatus3;
(*TxData++) = NVMNODIGIT.ECUStatus4;
(*TxData++) = NVMNODIGIT.ECUStatus5;
(*TxData++) = K_Line_Set.ECUStatus1;
(*TxData++) = K_Line_Set.ECUStatus2;
(*TxData++) = K_Line_Set.ECUStatus3;
(*TxData++) = K_Line_Set.ECUStatus4;
(*TxData++) = K_Line_Set.ECUStatus5;
Tx_Len = 7;
break;
*/
case 0xA2: /* */
(*TxData++) = KWP2000_READDATABYLOCALIDENTIFIER_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = 0xA2;
(*TxData++) = NVMNODIGIT.METERCOUNT; /*修正率替换次数*/
(*TxData++) = K_Line_Set.METERCOUNT; /*修正率替换次数*/
Tx_Len = 3;
break;
default: /* subFunctionNotSupported */
......@@ -1236,13 +1235,13 @@ unsigned char kwp_readDataStatusofDTC(unsigned char *TxData, unsigned char *Requ
if ((RequestData[1] == 0xFF)&&(RequestData[2] == 0x00))
{
(*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = NVMNODIGIT.NoOfDTCFF00;
(*TxData++) = K_Line_Set.NoOfDTCFF00;
Tx_Len = 2;
}
else if ((RequestData[1] == 0x80)&&(RequestData[2] == 0x00))
{
(*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = NVMNODIGIT.NoOfDTC8000;
(*TxData++) = K_Line_Set.NoOfDTC8000;
Tx_Len = 2;
}
else
......@@ -1256,13 +1255,13 @@ unsigned char kwp_readDataStatusofDTC(unsigned char *TxData, unsigned char *Requ
if ((RequestData[1] == 0xFF)&&(RequestData[2] == 0x00))
{
(*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = NVMNODIGIT.NoOfDTCFF01;
(*TxData++) = K_Line_Set.NoOfDTCFF01;
Tx_Len = 2;
}
else if ((RequestData[1] == 0x80)&&(RequestData[2] == 0x00))
{
(*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = NVMNODIGIT.NoOfDTC8001;
(*TxData++) = K_Line_Set.NoOfDTC8001;
Tx_Len = 2;
}
else
......@@ -1276,13 +1275,13 @@ unsigned char kwp_readDataStatusofDTC(unsigned char *TxData, unsigned char *Requ
if ((RequestData[1] == 0xFF)&&(RequestData[2] == 0x00))
{
(*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = NVMNODIGIT.NoOfDTCFF02;
(*TxData++) = K_Line_Set.NoOfDTCFF02;
Tx_Len = 2;
}
else if ((RequestData[1] == 0x80)&&(RequestData[2] == 0x00))
{
(*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = NVMNODIGIT.NoOfDTC8002;
(*TxData++) = K_Line_Set.NoOfDTC8002;
Tx_Len = 2;
}
else
......@@ -1295,13 +1294,13 @@ unsigned char kwp_readDataStatusofDTC(unsigned char *TxData, unsigned char *Requ
if ((RequestData[1] == 0xFF) && (RequestData[2] == 0x00))
{
(*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = NVMNODIGIT.NoOfDTCFF00;
(*TxData++) = K_Line_Set.NoOfDTCFF00;
Tx_Len = 2;
}
else if ((RequestData[1] == 0x80) && (RequestData[2] == 0x00))
{
(*TxData++) = KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = NVMNODIGIT.NoOfDTC8000;
(*TxData++) = K_Line_Set.NoOfDTC8000;
Tx_Len = 2;
}
else
......@@ -1335,7 +1334,7 @@ unsigned char kwp_ClearDiagnosticInformation(unsigned char *TxData, unsigned cha
(*TxData++) = KWP2000_CLEARDIAGNOSTICINFORMATION_REQUEST + KWP2000_POSITIVE_RESPONSE_OFFSET;
(*TxData++) = 0xFF;
(*TxData++) = 0x00;
// NVMNODIGIT.NoOfDTCFF00 == 0x00;
// K_Line_Set.NoOfDTCFF00 == 0x00;
Tx_Len = 3;
}
else
......
......@@ -145,36 +145,6 @@ extern _ECUStatus ECUStatusONE;
#define ECUSTATUST_F 00 /*修正系数 EOL系数*2048*/
/******************************************************************************
5.2.5. ECU ID_ECU件号写入(SID=$3B LID=$91)
******************************************************************************/
typedef union
{
unsigned char No_Digit1; //01 8
unsigned char No_Digit2; //02 9
unsigned char No_Digit3; //03 7
unsigned char No_Digit4; //04 9
unsigned char No_Digit5; //05 6
unsigned char No_Digit6; //06 8
unsigned char No_Digit7; //07 3
unsigned char No_Digit8; //08 0
unsigned char No_Digit9; //09 1
unsigned char No_Digit10; //10 0
unsigned char ECUStatus1; //11
unsigned char ECUStatus2; //12
unsigned char ECUStatus3; //13
unsigned char ECUStatus4; //14
unsigned char ECUStatus5; //15
unsigned char METERCOUNT; //16 修正率次数
unsigned char NoOfDTCFF00; //17
unsigned char NoOfDTC8000; //18
unsigned char TesterECU; //19 车速修正码
unsigned char TesterECUCAN; //20 CAN发送用修正码
} _NVMNODIGIT;
extern _NVMNODIGIT NVMNODIGIT;
extern unsigned char Sendseed1; /*仪表计算*/
extern unsigned char Sendseed2;
extern unsigned char Sendseed3;
......
......@@ -901,6 +901,24 @@ void K_LINE_EOL_InitVal(void)
K_Line_Set.K_Line_LID51 = 0x01u; /* 01 工作模式 */
K_Line_Set.K_Line_LID52 = 0x00u; /* 00 电子部件设定 */
K_Line_Set.ReservedB = 0x0A;
K_Line_Set.ReservedC = 0x0A;
K_Line_Set.No_Digit1 = 0x38u; //01
K_Line_Set.No_Digit2 = 0x39u; //02
K_Line_Set.No_Digit3 = 0x37u; //03
K_Line_Set.No_Digit4 = 0x39u; //04
K_Line_Set.No_Digit5 = 0x36u; //05
K_Line_Set.No_Digit6 = 0x38u; //06
K_Line_Set.No_Digit7 = 0x33u; //07
K_Line_Set.No_Digit8 = 0x30u; //08
K_Line_Set.No_Digit9 = 0x31u; //09
K_Line_Set.No_Digit10 = 0x30u; //10
K_Line_Set.ECUStatus1 = 0x00u; //11
K_Line_Set.ECUStatus2 = 0x00u; //12
K_Line_Set.ECUStatus3 = 0x00u; //13
K_Line_Set.ECUStatus4 = 0x00u; //14
K_Line_Set.ECUStatus5 = 0x00u; //15
K_Line_Set.METERCOUNT = 0x00u; //16
K_Line_Set.NoOfDTCFF00 = 0x00u; //17
K_Line_Set.NoOfDTC8000 = 0x00u; //18
K_Line_Set.TesterECU = 0x00u; //19
K_Line_Set.TesterECUCAN = 0x00u; //20
}
\ No newline at end of file
......@@ -73,22 +73,32 @@ typedef struct
uint8_t K_Line_LID50; /* -- 预留 */
uint8_t K_Line_LID51; /* 01 工作模式 0-工厂模式 1-通常模式 2-销售模式*/
uint8_t K_Line_LID52; /* 00 电子部件设定 0-500K 1-250k*/
uint8_t Reserved0;
uint8_t Reserved1;
uint8_t Reserved2;
uint8_t Reserved3;
uint8_t Reserved4;
uint8_t Reserved5;
uint8_t Reserved6;
uint8_t Reserved7;
uint8_t Reserved8;
uint8_t Reserved9;
uint8_t ReservedA;
uint8_t ReservedB;
uint8_t ReservedC;
uint8_t reserve;
uint8_t No_Digit1; //01
uint8_t No_Digit2; //02
uint8_t No_Digit3; //03
uint8_t No_Digit4; //04
uint8_t No_Digit5; //05
uint8_t No_Digit6; //06
uint8_t No_Digit7; //07
uint8_t No_Digit8; //08
uint8_t No_Digit9; //09
uint8_t No_Digit10; //10
uint8_t ECUStatus1; //11
uint8_t ECUStatus2; //12
uint8_t ECUStatus3; //13
uint8_t ECUStatus4; //14
uint8_t ECUStatus5; //15
uint8_t METERCOUNT; //16
uint8_t NoOfDTCFF00; //17
uint8_t NoOfDTC8000; //18
uint8_t TesterECU; //19
uint8_t TesterECUCAN; //20
} _EOL_K_LINE_SET;
extern _EOL_K_LINE_SET K_Line_Set;
......
......@@ -53,7 +53,7 @@ static const EEPROM_Block_st_t g_stEEPROMBlockTable[] =
{0xFF200A80UL, 0xFF200F7FUL, EEPROM_BLOCK7_BUFFER_SIZE, g_u32EEPROMBlock7Buffer,}, /*EEPROM_BLOCK_ODO_STAMP*/
{0xFF200F80UL, 0xFF20377FUL, EEPROM_BLOCK8_BUFFER_SIZE, g_u32EEPROMBlock8Buffer,}, /*EEPROM_BLOCK_TRIP_STAMP*/
{0xFF203780UL, 0xFF2037FFUL, EEPROM_BLOCK9_BUFFER_SIZE, g_u32EEPROMBlock9Buffer,}, /*EEPROM_BLOCK_SERVICE_INFO*/
{0xFF203800UL, 0xFF2038FFUL, EEPROM_BLOCK10_BUFFER_SIZE, g_u32EEPROMBlock10Buffer,}, /*EEPROM_BLOCK_EOL_K_LINE*/
{0xFF203800UL, 0xFF203940UL, EEPROM_BLOCK10_BUFFER_SIZE, g_u32EEPROMBlock10Buffer,}, /*EEPROM_BLOCK_EOL_K_LINE*/
};
/****************************************************************************
......
......@@ -48,7 +48,7 @@ enum g_enEEPROMBlockName
#define EEPROM_BLOCK_ODO_STAMP_SIZE (8U)/*Life:1000.0W*/
#define EEPROM_BLOCK_TRIP_STAMP_SIZE (80U)/*Life:1000.0W*/
#define EEPROM_BLOCK_SERVICE_INFO_SIZE (56U)/*Life:20.0W*/
#define EEPROM_BLOCK_EOL_K_LINE_SIZE (64U)/*Life:20.0W*/
#define EEPROM_BLOCK_EOL_K_LINE_SIZE (80U)/*Life:20.0W*/
#define EEPROM_TOTAL_BLOCK_NUM (11U)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment