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
597f4ed7
Commit
597f4ed7
authored
Jul 12, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:天有为清大计的时候清EE方式更改,由全部清除更改为将使用的部分清除
parent
6250b2a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
16 deletions
+26
-16
Key_user.c
Firmware/Source/Component/Key/Key_user.c
+12
-6
Services_Mileage_User.c
Firmware/Source/Component/Mileage/Services_Mileage_User.c
+1
-10
Services_Mileage_User.h
Firmware/Source/Component/Mileage/Services_Mileage_User.h
+13
-0
No files found.
Firmware/Source/Component/Key/Key_user.c
View file @
597f4ed7
...
...
@@ -484,8 +484,8 @@ void MenuData_TCS_Init(void)
uint8_t
ClearODO_Flag
=
0
;
void
TYW_RESET_ODO
(
void
)
{
uint8_t
Clear_EE
[
1
]
=
{
0xff
};
uint32_t
EE_Count
=
0U
;
uint8_t
Clear_EE
[
4
]
=
{
0xff
,
0xff
,
0xff
,
0xff
};
if
(
SYS_OPR_STAT_IGN_ON
)
{
if
(
ClearODO_Flag
<
1
)
...
...
@@ -494,10 +494,16 @@ void TYW_RESET_ODO(void)
{
ClearODO_Flag
=
1
;
Data_Mileage_Clear
();
for
(
EE_Count
=
0
;
EE_Count
<
255
;
EE_Count
++
)
{
eeprom_WriteRecord
(
EE_Count
,
(
uint8_t
*
)
&
Clear_EE
,
1
);
}
eeprom_WriteRecord
(
EEPROM_BLOCK_00
,
(
uint8_t
*
)
&
Clear_EE
,
4
);
eeprom_WriteRecord
(
EEPROM_BLOCK_01
,
(
uint8_t
*
)
&
Clear_EE
,
4
);
eeprom_WriteRecord
(
EEPROM_BLOCK_02
,
(
uint8_t
*
)
&
Clear_EE
,
4
);
eeprom_WriteRecord
(
EEPROM_BLOCK_03
,
(
uint8_t
*
)
&
Clear_EE
,
4
);
eeprom_WriteRecord
(
EEPROM_BLOCK_04
,
(
uint8_t
*
)
&
Clear_EE
,
4
);
eeprom_WriteRecord
(
EEPROM_BLOCK_05
,
(
uint8_t
*
)
&
Clear_EE
,
4
);
eeprom_WriteRecord
(
EEPROM_BLOCK_06
,
(
uint8_t
*
)
&
Clear_EE
,
4
);
eeprom_WriteRecord
(
EEPROM_BLOCK_07
,
(
uint8_t
*
)
&
Clear_EE
,
4
);
eeprom_WriteRecord
(
EEPROM_BLOCK_08
,
(
uint8_t
*
)
&
Clear_EE
,
4
);
eeprom_WriteRecord
(
EEPROM_BLOCK_09
,
(
uint8_t
*
)
&
Clear_EE
,
4
);
}
}
}
...
...
Firmware/Source/Component/Mileage/Services_Mileage_User.c
View file @
597f4ed7
...
...
@@ -10,16 +10,7 @@ uint8_t odo_writeState;
uint8_t
odo_readState
;
extern
uint32_t
NVM_User_Settings_Service
;
#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
;
...
...
Firmware/Source/Component/Mileage/Services_Mileage_User.h
View file @
597f4ed7
#ifndef __SERVICE_ODO_USER_H__
#define __SERVICE_ODO_USER_H__
//#define ONLY_CLEAR_ODO_MIL 0x01u /*仅根据距离信息进行ODO清除*/
//#define ONLY_CLEAR_ODO_NUM 0x01u /*仅根据次数信息进行ODO清除*/
#define CLEAR_ODO_NUM_MIL 0x01u
/*以距离信息以及次数信息进行ODO清除*/
...
...
@@ -8,6 +10,17 @@
#define ODO_CLEAR_NUM 5u
/*清除次数上限值 */
#define ODO_CLEAR_MIL 50000u
/*清除距离上限值 单位0.1KM*/
#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
extern
uint8_t
ODO_Clear_Num_Value
;
void
Data_User_Mileage_KL30Init
(
void
);
...
...
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