Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
TianYing_ty100
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TY
TianYing_ty100
Commits
657958d6
Commit
657958d6
authored
Jun 18, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:增加胎压学习结果的存储
parent
a2aed1b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
18 deletions
+23
-18
Services_Mileage_User.c
Firmware/Source/Component/Mileage/Services_Mileage_User.c
+23
-18
No files found.
Firmware/Source/Component/Mileage/Services_Mileage_User.c
View file @
657958d6
...
...
@@ -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
};
uint
32
_t
TPMSLearn
[
2
]
=
{
0
,
0
};
uint
8
_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
,
2
u
);
Data_User_EEPROM_Read
(
EM_MenuData_TPMS_LEARN
,
TempBuf
,
1
u
);
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment