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
a3c64709
Commit
a3c64709
authored
Sep 10, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐞
fix:代码评审问题:更改ee存储和读取的方式,使用ee库的接口函数,而非里程库里的接口
parent
9addd6e8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
37 deletions
+45
-37
Data_TPMS.c
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
+8
-4
Key_user.c
Firmware/Source/Component/Key/Key_user.c
+10
-8
Key_user.h
Firmware/Source/Component/Key/Key_user.h
+2
-2
Services_Mileage.h
Firmware/Source/Component/Mileage/Services_Mileage.h
+4
-4
Services_Mileage_User.c
Firmware/Source/Component/Mileage/Services_Mileage_User.c
+21
-19
No files found.
Firmware/Source/Application/Data_TPMS/Data_TPMS.c
View file @
a3c64709
...
@@ -10,7 +10,8 @@ uint8_t Can_341_Flg = 0;
...
@@ -10,7 +10,8 @@ uint8_t Can_341_Flg = 0;
void
Data_TPMS_KL30_Init
(
void
)
void
Data_TPMS_KL30_Init
(
void
)
{
{
uint8_t
TPMS_L
[
2
]
=
{
0
,
0
};
uint8_t
TPMS_L
[
2
]
=
{
0
,
0
};
Data_User_EEPROM_Read
(
EM_MenuData_TPMS_LEARN
,
(
uint32_t
*
)
TPMS_L
,
1u
);
//Data_User_EEPROM_Read(EM_MenuData_TPMS_LEARN, (uint32_t*)TPMS_L, 1u);
eeprom_ReadRecord
(
EEPROM_BLOCK_09
,
TPMS_L
,
2
);
MenuData
.
TPMS_Front_Learn
=
TPMS_L
[
0
];
MenuData
.
TPMS_Front_Learn
=
TPMS_L
[
0
];
MenuData
.
TPMS_Rear_Learn
=
TPMS_L
[
1
];
MenuData
.
TPMS_Rear_Learn
=
TPMS_L
[
1
];
//MenuData.TPMS_Front_FirstLearn_Flag = TPMS_L[2];
//MenuData.TPMS_Front_FirstLearn_Flag = TPMS_L[2];
...
@@ -38,7 +39,8 @@ void Data_TPMS_KL30_Init ( void )
...
@@ -38,7 +39,8 @@ void Data_TPMS_KL30_Init ( void )
void
Data_TPMS_KL15_WAKE_UP_Init
(
void
)
void
Data_TPMS_KL15_WAKE_UP_Init
(
void
)
{
{
uint8_t
TPMS_L
[
2
]
=
{
0
,
0
};
uint8_t
TPMS_L
[
2
]
=
{
0
,
0
};
Data_User_EEPROM_Read
(
EM_MenuData_TPMS_LEARN
,
(
uint32_t
*
)
TPMS_L
,
1
);
//Data_User_EEPROM_Read(EM_MenuData_TPMS_LEARN, (uint32_t*)TPMS_L, 1);
eeprom_ReadRecord
(
EEPROM_BLOCK_09
,
TPMS_L
,
2
);
MenuData
.
TPMS_Front_Learn
=
TPMS_L
[
0
];
MenuData
.
TPMS_Front_Learn
=
TPMS_L
[
0
];
MenuData
.
TPMS_Rear_Learn
=
TPMS_L
[
1
];
MenuData
.
TPMS_Rear_Learn
=
TPMS_L
[
1
];
//MenuData.TPMS_Front_FirstLearn_Flag = TPMS_L[2];
//MenuData.TPMS_Front_FirstLearn_Flag = TPMS_L[2];
...
@@ -338,7 +340,8 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -338,7 +340,8 @@ void Data_TPMS_Processing_Service ( void )
MenuData
.
TPMS_Front_Learn
=
TPMS
.
TPMS_Front_Learn
;
MenuData
.
TPMS_Front_Learn
=
TPMS
.
TPMS_Front_Learn
;
TPMS_L
[
0
]
=
MenuData
.
TPMS_Front_Learn
;
TPMS_L
[
0
]
=
MenuData
.
TPMS_Front_Learn
;
TPMS_L
[
1
]
=
MenuData
.
TPMS_Rear_Learn
;
TPMS_L
[
1
]
=
MenuData
.
TPMS_Rear_Learn
;
Data_User_EEPROM_Write
(
EM_MenuData_TPMS_LEARN
,
(
uint32_t
*
)
TPMS_L
,
1u
);
//Data_User_EEPROM_Write(EM_MenuData_TPMS_LEARN, (uint32_t*)TPMS_L, 1u);
eeprom_WriteRecord
(
EEPROM_BLOCK_09
,
TPMS_L
,
2
);
}
}
...
@@ -347,7 +350,8 @@ void Data_TPMS_Processing_Service ( void )
...
@@ -347,7 +350,8 @@ void Data_TPMS_Processing_Service ( void )
MenuData
.
TPMS_Rear_Learn
=
TPMS
.
TPMS_Rear_Learn
;
MenuData
.
TPMS_Rear_Learn
=
TPMS
.
TPMS_Rear_Learn
;
TPMS_L
[
0
]
=
MenuData
.
TPMS_Front_Learn
;
TPMS_L
[
0
]
=
MenuData
.
TPMS_Front_Learn
;
TPMS_L
[
1
]
=
MenuData
.
TPMS_Rear_Learn
;
TPMS_L
[
1
]
=
MenuData
.
TPMS_Rear_Learn
;
Data_User_EEPROM_Write
(
EM_MenuData_TPMS_LEARN
,
(
uint32_t
*
)
TPMS_L
,
1u
);
//Data_User_EEPROM_Write(EM_MenuData_TPMS_LEARN, (uint32_t*)TPMS_L, 1u);
eeprom_WriteRecord
(
EEPROM_BLOCK_09
,
TPMS_L
,
2
);
}
}
...
...
Firmware/Source/Component/Key/Key_user.c
View file @
a3c64709
...
@@ -16,11 +16,11 @@ uint8_t Tpms_TX_Flag = 0;
...
@@ -16,11 +16,11 @@ uint8_t Tpms_TX_Flag = 0;
//RTC_DateTypeDef RTC_DateStruct;
//RTC_DateTypeDef RTC_DateStruct;
RTC_CounterTypeDef
counter_val
;
RTC_CounterTypeDef
counter_val
;
void
Data_TCS_Set_OnOff
(
uint
32_t
u32
Data
)
void
Data_TCS_Set_OnOff
(
uint
8_t
u8
Data
)
{
{
uint
32_t
u32
Data1
[
1u
]
=
{
0
};
uint
8_t
u8
Data1
[
1u
]
=
{
0
};
u
32Data1
[
0u
]
=
u32Data
;
u
8Data1
[
0u
]
=
u8Data
;
Data_User_EEPROM_Write
(
EM_MenuData_Tcs_Val
,
u32Data1
,
1u
);
eeprom_WriteRecord
(
EEPROM_BLOCK_08
,
(
uint8_t
*
)
u8Data
,
1
);
}
}
void
Key_Operation_Left
(
Key_Event_en_t
enKeyEvent
)
//Mode
void
Key_Operation_Left
(
Key_Event_en_t
enKeyEvent
)
//Mode
...
@@ -485,8 +485,9 @@ void Menu_u8Data_Updata_Process(uint8_t updateDir , uint8_t datMax, uint8_t datM
...
@@ -485,8 +485,9 @@ void Menu_u8Data_Updata_Process(uint8_t updateDir , uint8_t datMax, uint8_t datM
void
MenuData_Unit_Init
(
void
)
void
MenuData_Unit_Init
(
void
)
{
{
uint32_t
TCS
[
1
]
=
{
0
};
uint8_t
TCS
[
1
]
=
{
0
};
Data_User_EEPROM_Read
(
EM_MenuData_Tcs_Val
,
TCS
,
1u
);
//Data_User_EEPROM_Read(EM_MenuData_Tcs_Val, TCS, 1u);
eeprom_ReadRecord
(
EEPROM_BLOCK_08
,
TCS
,
1
);
MenuData
.
KM_Unit
=
0
;
MenuData
.
KM_Unit
=
0
;
//MenuData.Tpms_Unit = 0;
//MenuData.Tpms_Unit = 0;
MenuData
.
Tcs_Val
=
TCS
[
0
];
MenuData
.
Tcs_Val
=
TCS
[
0
];
...
@@ -494,8 +495,9 @@ void MenuData_Unit_Init(void)
...
@@ -494,8 +495,9 @@ void MenuData_Unit_Init(void)
}
}
void
MenuData_TCS_Init
(
void
)
void
MenuData_TCS_Init
(
void
)
{
{
uint32_t
TCS
[
1
]
=
{
0
};
uint8_t
TCS
[
1
]
=
{
0
};
Data_User_EEPROM_Read
(
EM_MenuData_Tcs_Val
,
TCS
,
1u
);
//Data_User_EEPROM_Read(EM_MenuData_Tcs_Val, TCS, 1u);
eeprom_ReadRecord
(
EEPROM_BLOCK_08
,
TCS
,
1
);
MenuData
.
Tcs_Val
=
TCS
[
0
];
MenuData
.
Tcs_Val
=
TCS
[
0
];
PageType
=
Page_Menu
;
PageType
=
Page_Menu
;
Hour_Set
=
0
;
Hour_Set
=
0
;
...
...
Firmware/Source/Component/Key/Key_user.h
View file @
a3c64709
...
@@ -19,7 +19,7 @@ typedef struct __attribute__((aligned(4)))
...
@@ -19,7 +19,7 @@ typedef struct __attribute__((aligned(4)))
uint8_t
Dis_Minute
;
uint8_t
Dis_Minute
;
uint8_t
KM_Unit
;
// 0 km, 1 mile
uint8_t
KM_Unit
;
// 0 km, 1 mile
uint8_t
Tpms_Unit
;
// 0 bar, 1 psi
uint8_t
Tpms_Unit
;
// 0 bar, 1 psi
uint
32_t
Tcs_Val
;
// 0 off, 1 on
uint
8_t
Tcs_Val
;
// 0 off, 1 on
uint8_t
TPMS_Front_Learn
;
uint8_t
TPMS_Front_Learn
;
uint8_t
TPMS_Rear_Learn
;
uint8_t
TPMS_Rear_Learn
;
uint8_t
TPMS_Front_FirstLearn_Flag
;
uint8_t
TPMS_Front_FirstLearn_Flag
;
...
@@ -77,6 +77,6 @@ void Key_Check_Service(void);
...
@@ -77,6 +77,6 @@ void Key_Check_Service(void);
void
MenuData_Unit_Init
(
void
);
void
MenuData_Unit_Init
(
void
);
void
Maintain_Reset_Service
(
void
);
void
Maintain_Reset_Service
(
void
);
void
MenuData_TCS_Init
(
void
);
void
MenuData_TCS_Init
(
void
);
void
Data_TCS_Set_OnOff
(
uint
32_t
u32
Data
);
void
Data_TCS_Set_OnOff
(
uint
8_t
u8
Data
);
uint8_t
Get_Tpms_TX_Flag
(
void
);
uint8_t
Get_Tpms_TX_Flag
(
void
);
#endif
#endif
Firmware/Source/Component/Mileage/Services_Mileage.h
View file @
a3c64709
...
@@ -51,10 +51,10 @@ typedef enum
...
@@ -51,10 +51,10 @@ typedef enum
EM_MILEAGE_BLOCK
=
0u
,
/**< 累计里程 */
EM_MILEAGE_BLOCK
=
0u
,
/**< 累计里程 */
EM_ODO_BLOCK
,
/**< 总计里程 */
EM_ODO_BLOCK
,
/**< 总计里程 */
EM_TRIP_BLOCK
,
/**< 小计里程 */
EM_TRIP_BLOCK
,
/**< 小计里程 */
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学习结果 */
//
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
);
...
...
Firmware/Source/Component/Mileage/Services_Mileage_User.c
View file @
a3c64709
...
@@ -89,21 +89,23 @@ void Data_User_Mileage_KL30Init(void)
...
@@ -89,21 +89,23 @@ void Data_User_Mileage_KL30Init(void)
TripInit
[
EM_TRIP_D
].
IsRestart
=
1u
;
TripInit
[
EM_TRIP_D
].
IsRestart
=
1u
;
Data_Trip_KL30_Init
(
DataTripBuf
,
TripInit
,
EM_TRIP_MAX
,
Func
.
EEPromWrite_Cbk
);
Data_Trip_KL30_Init
(
DataTripBuf
,
TripInit
,
EM_TRIP_MAX
,
Func
.
EEPromWrite_Cbk
);
Data_User_EEPROM_Read
(
EM_MenuData_Tcs_Val
,
TempBuf
,
1u
);
//Data_User_EEPROM_Read(EM_MenuData_Tcs_Val, TempBuf, 1u);
eeprom_ReadRecord
(
EEPROM_BLOCK_08
,
(
uint8_t
*
)
TempBuf
,
1
);
if
(
TempBuf
[
0u
]
==
0xFFFFFFFF
)
if
(
TempBuf
[
0u
]
==
0xFFFFFFFF
)
{
{
MenuData
.
Tcs_Val
=
1
;
MenuData
.
Tcs_Val
=
1
;
Data_User_EEPROM_Write
(
EM_MenuData_Tcs_Val
,
&
MenuData
.
Tcs_Val
,
1u
);
//Data_User_EEPROM_Write(EM_MenuData_Tcs_Val, &MenuData.Tcs_Val, 1u);
eeprom_WriteRecord
(
EEPROM_BLOCK_08
,
&
MenuData
.
Tcs_Val
,
1
);
}
}
Data_User_EEPROM_Read
(
EM_MenuData_TPMS_LEARN
,
TempBuf
,
1u
);
//Data_User_EEPROM_Read(EM_MenuData_TPMS_LEARN, TempBuf, 1u);
eeprom_ReadRecord
(
EEPROM_BLOCK_09
,
(
uint8_t
*
)
TempBuf
,
2
);
if
(
TempBuf
[
0u
]
==
0xFFFFFFFF
)
if
(
TempBuf
[
0u
]
==
0xFFFFFFFF
)
{
{
TPMSLearn
[
0
]
=
0
;
//MenuData.TPMS_Front_Learn;
TPMSLearn
[
0
]
=
0
;
//MenuData.TPMS_Front_Learn;
TPMSLearn
[
1
]
=
0
;
//MenuData.TPMS_Rear_Learn;
TPMSLearn
[
1
]
=
0
;
//MenuData.TPMS_Rear_Learn;
//TPMSLearn[2] = 0;//MenuData.TPMS_Front_FirstLearn_Flag;
//Data_User_EEPROM_Write(EM_MenuData_TPMS_LEARN, (uint32_t *)TPMSLearn, 1u);
//TPMSLearn[3] = 0;//MenuData.TPMS_Rear_FirstLearn_Flag;
eeprom_WriteRecord
(
EEPROM_BLOCK_09
,
TPMSLearn
,
2
);
Data_User_EEPROM_Write
(
EM_MenuData_TPMS_LEARN
,
(
uint32_t
*
)
TPMSLearn
,
1u
);
}
}
Milleage_InitFlag
=
0X5AA53AA3UL
;
Milleage_InitFlag
=
0X5AA53AA3UL
;
...
@@ -158,12 +160,12 @@ uint32_t Get_MileageInit_Status(void)
...
@@ -158,12 +160,12 @@ uint32_t Get_MileageInit_Status(void)
// case EM_Maintenance_Firstflg:
// case EM_Maintenance_Firstflg:
// eeprom_ReadRecord(EEPROM_BLOCK_07, (uint8_t *)u32Data, u16Len * 4);
// eeprom_ReadRecord(EEPROM_BLOCK_07, (uint8_t *)u32Data, u16Len * 4);
// break;
// break;
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
:
//
case EM_MenuData_TPMS_LEARN:
eeprom_ReadRecord
(
EEPROM_BLOCK_09
,
(
uint8_t
*
)
u32Data
,
u16Len
*
2
);
//
eeprom_ReadRecord(EEPROM_BLOCK_09, (uint8_t *)u32Data, u16Len * 2);
break
;
//
break;
default:
default:
...
@@ -207,12 +209,12 @@ uint32_t Get_MileageInit_Status(void)
...
@@ -207,12 +209,12 @@ uint32_t Get_MileageInit_Status(void)
// case EM_Maintenance_Firstflg:
// case EM_Maintenance_Firstflg:
// eeprom_WriteRecord(EEPROM_BLOCK_07, (uint8_t *)u32Data, u16Len * 4);
// eeprom_WriteRecord(EEPROM_BLOCK_07, (uint8_t *)u32Data, u16Len * 4);
// break;
// break;
case
EM_MenuData_Tcs_Val
:
//
case EM_MenuData_Tcs_Val:
eeprom_WriteRecord
(
EEPROM_BLOCK_08
,
(
uint8_t
*
)
u32Data
,
u16Len
*
1
);
//
eeprom_WriteRecord(EEPROM_BLOCK_08, (uint8_t *)u32Data, u16Len * 1);
break
;
//
break;
case
EM_MenuData_TPMS_LEARN
:
//
case EM_MenuData_TPMS_LEARN:
eeprom_WriteRecord
(
EEPROM_BLOCK_09
,
(
uint8_t
*
)
u32Data
,
u16Len
*
2
);
//
eeprom_WriteRecord(EEPROM_BLOCK_09, (uint8_t *)u32Data, u16Len * 2);
break
;
//
break;
default:
default:
break
;
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