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
baizhengyuan
TianYing_ty100
Commits
f1180d72
Commit
f1180d72
authored
Sep 26, 2024
by
陈家乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:保养问题,小计清零时传入长度为32字节,实际只写入一次16字节,导致下次调用写EE时,跳过前16字节。判断写EE返回值,写入完整数据
parent
012b8d05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
Services_Mileage_User.c
Firmware/Source/Component/Mileage/Services_Mileage_User.c
+12
-2
No files found.
Firmware/Source/Component/Mileage/Services_Mileage_User.c
View file @
f1180d72
...
...
@@ -7,6 +7,8 @@ uint8_t DataTripBuf[Data_MEM_Block_Trip * EM_TRIP_MAX];
Mileage_t
g_WriteMileage
;
Mileage_t
g_ReadMileage
;
uint8_t
odo_writeState
;
uint8_t
odoclr_writeState
;
uint8_t
trip_writeState
;
uint8_t
odo_readState
;
uint32_t
Milleage_InitFlag
=
0U
;
/******************************************************************************
...
...
@@ -203,11 +205,19 @@ uint32_t Data_User_EEPROM_Read(uint16_t u16BlockID, uint32_t u32Data[], uint16_t
break
;
case
EM_ODO_BLOCK
:
eeprom_WriteRecord
(
EEPROM_BLOCK_01
,
(
uint8_t
*
)
u32Data
,
u16Len
*
4
);
odoclr_writeState
=
eeprom_WriteRecord
(
EEPROM_BLOCK_01
,
(
uint8_t
*
)
u32Data
,
u16Len
*
4
);
while
(
odoclr_writeState
==
WRITING
)
{
odoclr_writeState
=
eeprom_WriteRecord
(
EEPROM_BLOCK_01
,
(
uint8_t
*
)
u32Data
,
u16Len
*
4
);
}
break
;
case
EM_TRIP_BLOCK
:
eeprom_WriteRecord
(
EEPROM_BLOCK_03
,
(
uint8_t
*
)
u32Data
,
u16Len
*
4
);
trip_writeState
=
eeprom_WriteRecord
(
EEPROM_BLOCK_03
,
(
uint8_t
*
)
u32Data
,
u16Len
*
4
);
while
(
trip_writeState
==
WRITING
)
{
trip_writeState
=
eeprom_WriteRecord
(
EEPROM_BLOCK_03
,
(
uint8_t
*
)
u32Data
,
u16Len
*
4
);
}
break
;
// case EM_Maintenance_BLOCK:
...
...
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