Commit 657958d6 authored by 李俭双's avatar 李俭双

🐞 fix:增加胎压学习结果的存储

parent a2aed1b8
......@@ -10,16 +10,18 @@ uint8_t odo_writeState;
uint8_t odo_readState;
extern uint32_t NVM_User_Settings_Service;
#define EEPROM_BLOCK_00 00
#define EEPROM_BLOCK_01 16
#define EEPROM_BLOCK_02 32
#define EEPROM_BLOCK_03 48
#define EEPROM_BLOCK_04 64
#define EEPROM_BLOCK_05 80
#define EEPROM_BLOCK_06 96
#define EEPROM_BLOCK_07 112
#define EEPROM_BLOCK_08 128
#define EEPROM_BLOCK_09 144
#define EEPROM_BLOCK_00 0x00
#define EEPROM_BLOCK_01 0x16
#define EEPROM_BLOCK_02 0x32
#define EEPROM_BLOCK_03 0x48
#define EEPROM_BLOCK_04 0x64
#define EEPROM_BLOCK_05 0x80
#define EEPROM_BLOCK_06 0x90
#define EEPROM_BLOCK_07 0xA0
#define EEPROM_BLOCK_08 0xB0
#define EEPROM_BLOCK_09 0xC0
uint32_t Milleage_InitFlag = 0U;
......@@ -39,7 +41,7 @@ void Data_User_Mileage_KL30Init(void)
ODO_Init_t ODOInit = {0};
uint32_t Maintenance_Firstflg[1u] = {0};
Trip_Init_t TripInit[4] = {0};
uint32_t TPMSLearn[2] = {0,0};
uint8_t TPMSLearn[2] = {0,0};
Milleage_InitFlag = 0U;
// �������ݴ�EEPROM�ж�ȡ
(void)Data_User_EEPROM_Read(EM_MILEAGE_BLOCK, TempBuf, 1);
......@@ -119,12 +121,14 @@ void Data_User_Mileage_KL30Init(void)
Data_User_EEPROM_Write(EM_MenuData_Tcs_Val, &MenuData.Tcs_Val, 1u);
}
Data_User_EEPROM_Read(EM_MenuData_TPMS_LEARN, TempBuf, 2u);
Data_User_EEPROM_Read(EM_MenuData_TPMS_LEARN, TempBuf, 1u);
if (TempBuf[0u] == 0xFFFFFFFF)
{
TPMSLearn[0] = MenuData.TPMS_Front_Learn;
TPMSLearn[1] = MenuData.TPMS_Rear_Learn;
Data_User_EEPROM_Write(EM_MenuData_TPMS_LEARN, TPMSLearn, 2u);
TPMSLearn[0] = 0;//MenuData.TPMS_Front_Learn;
TPMSLearn[1] = 0;//MenuData.TPMS_Rear_Learn;
//TPMSLearn[2] = 0;//MenuData.TPMS_Front_FirstLearn_Flag;
//TPMSLearn[3] = 0;//MenuData.TPMS_Rear_FirstLearn_Flag;
Data_User_EEPROM_Write(EM_MenuData_TPMS_LEARN, (uint32_t *)TPMSLearn, 1u);
}
Milleage_InitFlag = 0X5AA53AA3UL;
......@@ -183,8 +187,9 @@ uint32_t Get_MileageInit_Status(void)
eeprom_ReadRecord(EEPROM_BLOCK_08, (uint8_t *)u32Data, u16Len * 4);
break;
case EM_MenuData_TPMS_LEARN:
eeprom_ReadRecord(EEPROM_BLOCK_09, (uint8_t *)u32Data, u16Len * 4);
eeprom_ReadRecord(EEPROM_BLOCK_09, (uint8_t *)u32Data, u16Len * 2);
break;
default:
break;
......@@ -228,10 +233,10 @@ uint32_t Get_MileageInit_Status(void)
eeprom_WriteRecord(EEPROM_BLOCK_07, (uint8_t *)u32Data, u16Len * 4);
break;
case EM_MenuData_Tcs_Val:
eeprom_WriteRecord(EEPROM_BLOCK_08, (uint8_t *)u32Data, u16Len * 4);
eeprom_WriteRecord(EEPROM_BLOCK_08, (uint8_t *)u32Data, u16Len * 1);
break;
case EM_MenuData_TPMS_LEARN:
eeprom_WriteRecord(EEPROM_BLOCK_09, (uint8_t *)u32Data, u16Len * 4);
eeprom_WriteRecord(EEPROM_BLOCK_09, (uint8_t *)u32Data, u16Len * 2);
break;
default:
break;
......
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