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
aa8f3c5a
Commit
aa8f3c5a
authored
Jun 03, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:规范变更,TCS开关存储到EE记忆
parent
15ec1ef6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
8 deletions
+34
-8
Key_user.c
Firmware/Source/Component/Key/Key_user.c
+16
-4
Key_user.h
Firmware/Source/Component/Key/Key_user.h
+3
-1
Services_Mileage.h
Firmware/Source/Component/Mileage/Services_Mileage.h
+1
-1
Services_Mileage_User.c
Firmware/Source/Component/Mileage/Services_Mileage_User.c
+14
-2
No files found.
Firmware/Source/Component/Key/Key_user.c
View file @
aa8f3c5a
...
...
@@ -11,11 +11,17 @@ uint8_t PageType = 0;
uint8_t
PageMenu
=
0
;
uint8_t
Hour_Set
=
0
;
uint8_t
Minute_Set
=
0
;
RTC_TimeTypeDef
RTC_TimeStruct
;
RTC_DateTypeDef
RTC_DateStruct
;
RTC_CounterTypeDef
counter_val
;
void
Data_TCS_Set_OnOff
(
uint32_t
u32Data
)
{
uint32_t
u32Data1
[
1u
]
=
{
0
};
u32Data1
[
0u
]
=
u32Data
;
Data_User_EEPROM_Write
(
EM_MenuData_Tcs_Val
,
u32Data1
,
1u
);
}
void
Key_Operation_Left
(
Key_Event_en_t
enKeyEvent
)
//Mode
{
switch
(
enKeyEvent
)
...
...
@@ -50,10 +56,12 @@ void Key_Operation_Left(Key_Event_en_t enKeyEvent)//Mode
if
(
Get_Dis_Tcs_Val
()
==
0
)
{
MenuData
.
Tcs_Val
=
1
;
//on
Data_TCS_Set_OnOff
(
MenuData
.
Tcs_Val
);
}
else
{
MenuData
.
Tcs_Val
=
0
;
//off
Data_TCS_Set_OnOff
(
MenuData
.
Tcs_Val
);
}
}
...
...
@@ -410,14 +418,18 @@ void Menu_u8Data_Updata_Process(uint8_t updateDir , uint8_t datMax, uint8_t datM
void
MenuData_Unit_Init
(
void
)
{
uint32_t
TCS
[
1
]
=
{
0
};
Data_User_EEPROM_Read
(
EM_MenuData_Tcs_Val
,
TCS
,
1u
);
MenuData
.
KM_Unit
=
0
;
MenuData
.
Tpms_Unit
=
0
;
MenuData
.
Tcs_Val
=
1
;
MenuData
.
Tcs_Val
=
TCS
[
0
]
;
}
void
MenuData_TCS_Init
(
void
)
{
MenuData
.
Tcs_Val
=
1
;
uint32_t
TCS
[
1
]
=
{
0
};
Data_User_EEPROM_Read
(
EM_MenuData_Tcs_Val
,
TCS
,
1u
);
MenuData
.
Tcs_Val
=
TCS
[
0
];
PageType
=
Page_Menu
;
Hour_Set
=
0
;
Minute_Set
=
0
;
...
...
Firmware/Source/Component/Key/Key_user.h
View file @
aa8f3c5a
...
...
@@ -19,7 +19,7 @@ typedef struct
uint8_t
Dis_Minute
;
uint8_t
KM_Unit
;
// 0 km, 1 mile
uint8_t
Tpms_Unit
;
// 0 bar, 1 psi
uint
8_t
Tcs_Val
;
// 0 off, 1 on
uint
32_t
Tcs_Val
;
// 0 off, 1 on
}
_Menu_Data
;
typedef
enum
...
...
@@ -46,6 +46,7 @@ typedef enum
extern
uint8_t
PageType
;
extern
uint8_t
ClearODO_Flag
;
extern
_Menu_Data
MenuData
;
extern
RTC_CounterTypeDef
counter_val
;
extern
void
Key_KL30_Init_EXample
(
void
);
extern
void
Key_Wakeup_Init_EXample
(
void
);
...
...
@@ -71,4 +72,5 @@ void Key_Check_Service(void);
void
MenuData_Unit_Init
(
void
);
void
Maintain_Reset_Service
(
void
);
void
MenuData_TCS_Init
(
void
);
void
Data_TCS_Set_OnOff
(
uint32_t
u32Data
);
#endif
Firmware/Source/Component/Mileage/Services_Mileage.h
View file @
aa8f3c5a
...
...
@@ -53,7 +53,7 @@ typedef enum
EM_TRIP_BLOCK
,
/**< 小计里程 */
EM_Maintenance_BLOCK
,
/**< 保养里程 */
EM_Maintenance_Firstflg
,
/**< 保养标志 */
EM_
ENGODO_BLOCK
,
/**< 发动机总里程
*/
EM_
MenuData_Tcs_Val
,
/**< TCS开关标志
*/
}
Data_EEPROM_Enum_t
;
typedef
void
(
*
EEPromWrite
)(
Data_EEPROM_Enum_t
BlockID
,
Millib_uint32_t
u32Data
[],
Millib_uint16_t
u16Len
);
...
...
Firmware/Source/Component/Mileage/Services_Mileage_User.c
View file @
aa8f3c5a
...
...
@@ -18,6 +18,7 @@ extern uint32_t NVM_User_Settings_Service;
#define EEPROM_BLOCK_05 80
#define EEPROM_BLOCK_06 96
#define EEPROM_BLOCK_07 112
#define EEPROM_BLOCK_08 128
uint32_t
Milleage_InitFlag
=
0U
;
...
...
@@ -110,6 +111,13 @@ void Data_User_Mileage_KL30Init(void)
Data_User_EEPROM_Write
(
EM_Maintenance_BLOCK
,
&
NVM_User_Settings_Service
,
1u
);
}
Data_User_EEPROM_Read
(
EM_MenuData_Tcs_Val
,
TempBuf
,
1u
);
if
(
TempBuf
[
0u
]
==
0xFFFFFFFF
)
{
MenuData
.
Tcs_Val
=
1
;
Data_User_EEPROM_Write
(
EM_MenuData_Tcs_Val
,
&
MenuData
.
Tcs_Val
,
1u
);
}
Milleage_InitFlag
=
0X5AA53AA3UL
;
}
...
...
@@ -134,7 +142,6 @@ void Data_User_Mileage_WakeupInit(void)
uint32_t
Get_MileageInit_Status
(
void
)
{
return
Milleage_InitFlag
;
}
...
...
@@ -163,6 +170,9 @@ uint32_t Get_MileageInit_Status(void)
case
EM_Maintenance_Firstflg
:
eeprom_ReadRecord
(
EEPROM_BLOCK_07
,
(
uint8_t
*
)
u32Data
,
u16Len
*
4
);
break
;
case
EM_MenuData_Tcs_Val
:
eeprom_ReadRecord
(
EEPROM_BLOCK_08
,
(
uint8_t
*
)
u32Data
,
u16Len
*
4
);
break
;
default:
break
;
...
...
@@ -205,7 +215,9 @@ uint32_t Get_MileageInit_Status(void)
case
EM_Maintenance_Firstflg
:
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
);
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