Commit 09513099 authored by 李俭双's avatar 李俭双

feat:依据规范变更,增加胎压学习存储

parent 5ca8aafa
...@@ -54,6 +54,7 @@ typedef enum ...@@ -54,6 +54,7 @@ typedef enum
EM_Maintenance_BLOCK, /**< 保养里程 */ EM_Maintenance_BLOCK, /**< 保养里程 */
EM_Maintenance_Firstflg, /**< 保养标志 */ EM_Maintenance_Firstflg, /**< 保养标志 */
EM_MenuData_Tcs_Val, /**< TCS开关标志 */ EM_MenuData_Tcs_Val, /**< TCS开关标志 */
EM_MenuData_TPMS_LEARN, /**< TPMS学习结果 */
} Data_EEPROM_Enum_t; } Data_EEPROM_Enum_t;
typedef void (*EEPromWrite)(Data_EEPROM_Enum_t BlockID, Millib_uint32_t u32Data[], Millib_uint16_t u16Len); typedef void (*EEPromWrite)(Data_EEPROM_Enum_t BlockID, Millib_uint32_t u32Data[], Millib_uint16_t u16Len);
......
...@@ -19,7 +19,7 @@ extern uint32_t NVM_User_Settings_Service; ...@@ -19,7 +19,7 @@ extern uint32_t NVM_User_Settings_Service;
#define EEPROM_BLOCK_06 96 #define EEPROM_BLOCK_06 96
#define EEPROM_BLOCK_07 112 #define EEPROM_BLOCK_07 112
#define EEPROM_BLOCK_08 128 #define EEPROM_BLOCK_08 128
#define EEPROM_BLOCK_09 144
uint32_t Milleage_InitFlag = 0U; uint32_t Milleage_InitFlag = 0U;
...@@ -39,6 +39,7 @@ void Data_User_Mileage_KL30Init(void) ...@@ -39,6 +39,7 @@ void Data_User_Mileage_KL30Init(void)
ODO_Init_t ODOInit = {0}; ODO_Init_t ODOInit = {0};
uint32_t Maintenance_Firstflg[1u] = {0}; uint32_t Maintenance_Firstflg[1u] = {0};
Trip_Init_t TripInit[4] = {0}; Trip_Init_t TripInit[4] = {0};
uint32_t TPMSLearn[2] = {0,0};
Milleage_InitFlag = 0U; Milleage_InitFlag = 0U;
// �������ݴ�EEPROM�ж�ȡ // �������ݴ�EEPROM�ж�ȡ
(void)Data_User_EEPROM_Read(EM_MILEAGE_BLOCK, TempBuf, 1); (void)Data_User_EEPROM_Read(EM_MILEAGE_BLOCK, TempBuf, 1);
...@@ -118,6 +119,14 @@ void Data_User_Mileage_KL30Init(void) ...@@ -118,6 +119,14 @@ void Data_User_Mileage_KL30Init(void)
Data_User_EEPROM_Write(EM_MenuData_Tcs_Val, &MenuData.Tcs_Val, 1u); Data_User_EEPROM_Write(EM_MenuData_Tcs_Val, &MenuData.Tcs_Val, 1u);
} }
Data_User_EEPROM_Read(EM_MenuData_TPMS_LEARN, TempBuf, 2u);
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);
}
Milleage_InitFlag = 0X5AA53AA3UL; Milleage_InitFlag = 0X5AA53AA3UL;
} }
...@@ -173,6 +182,9 @@ uint32_t Get_MileageInit_Status(void) ...@@ -173,6 +182,9 @@ uint32_t Get_MileageInit_Status(void)
case EM_MenuData_Tcs_Val: case EM_MenuData_Tcs_Val:
eeprom_ReadRecord(EEPROM_BLOCK_08, (uint8_t *)u32Data, u16Len * 4); eeprom_ReadRecord(EEPROM_BLOCK_08, (uint8_t *)u32Data, u16Len * 4);
break; break;
case EM_MenuData_TPMS_LEARN:
eeprom_ReadRecord(EEPROM_BLOCK_09, (uint8_t *)u32Data, u16Len * 4);
break;
default: default:
break; break;
...@@ -218,6 +230,9 @@ uint32_t Get_MileageInit_Status(void) ...@@ -218,6 +230,9 @@ uint32_t Get_MileageInit_Status(void)
case EM_MenuData_Tcs_Val: case EM_MenuData_Tcs_Val:
eeprom_WriteRecord(EEPROM_BLOCK_08, (uint8_t *)u32Data, u16Len * 4); eeprom_WriteRecord(EEPROM_BLOCK_08, (uint8_t *)u32Data, u16Len * 4);
break; break;
case EM_MenuData_TPMS_LEARN:
eeprom_WriteRecord(EEPROM_BLOCK_09, (uint8_t *)u32Data, u16Len * 4);
break;
default: default:
break; 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