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
6841750c
Commit
6841750c
authored
May 06, 2024
by
李俭双
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://tyw-server.synology.me:12345/ty/tianying_ty100
into lijianshuang
parents
3fa98a0d
3458d39c
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
176 additions
and
155 deletions
+176
-155
HaoJin.uvprojx
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/HaoJin.uvprojx
+5
-5
Data_VSpeed.c
Firmware/Source/Application/Data_VSpeed/Data_VSpeed.c
+2
-2
SEG_DISPLAY.c
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
+3
-3
Key.h
Firmware/Source/Component/Key/Key.h
+1
-1
Key_user.c
Firmware/Source/Component/Key/Key_user.c
+137
-125
Key_user.h
Firmware/Source/Component/Key/Key_user.h
+16
-12
Services_Mileage_User.c
Firmware/Source/Component/Mileage/Services_Mileage_User.c
+11
-6
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+1
-1
No files found.
Firmware/Project/Cmsemicon/BAT32A239/MDK_ARM/HaoJin.uvprojx
View file @
6841750c
...
...
@@ -16,7 +16,7 @@
<TargetCommonOption>
<Device>
BAT32A239KK64FB
</Device>
<Vendor>
Cmsemicon
</Vendor>
<PackID>
Cmsemicon.BAT32A239.1.0.
3
</PackID>
<PackID>
Cmsemicon.BAT32A239.1.0.
5
</PackID>
<PackURL>
http://www.mcu.com.cn/pack/
</PackURL>
<Cpu>
IRAM(0x20000000,0x08000) IROM(0x00000000,0x40000) CPUTYPE("Cortex-M0+") CLOCK(12000000) ELITTLE
</Cpu>
<FlashUtilSpec></FlashUtilSpec>
...
...
@@ -1156,7 +1156,7 @@
<file
attr=
"config"
category=
"source"
name=
"Device\Source\isr_BAT32A239.c"
version=
"1.0.0"
>
<instance
index=
"0"
>
RTE\Device\BAT32A239KK64FB\isr_BAT32A239.c
</instance>
<component
Cclass=
"Device"
Cgroup=
"ISR"
Cvendor=
"Cmsemicon"
Cversion=
"1.0.0"
condition=
"BAT32A239 CMSIS-CORE"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
3
"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
5
"
/>
<targetInfos>
<targetInfo
name=
"HaoJin232"
/>
</targetInfos>
...
...
@@ -1164,7 +1164,7 @@
<file
attr=
"config"
category=
"source"
condition=
"Startup ARM"
name=
"Device\Source\ARM\startup_BAT32A239.s"
version=
"1.0.0"
>
<instance
index=
"0"
>
RTE\Device\BAT32A239KK64FB\startup_BAT32A239.s
</instance>
<component
Cclass=
"Device"
Cgroup=
"Startup"
Cvendor=
"Cmsemicon"
Cversion=
"1.0.0"
condition=
"BAT32A239 CMSIS-CORE"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
3
"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
5
"
/>
<targetInfos>
<targetInfo
name=
"HaoJin232"
/>
</targetInfos>
...
...
@@ -1172,7 +1172,7 @@
<file
attr=
"config"
category=
"source"
name=
"Device\Source\system_BAT32A239.c"
version=
"1.0.0"
>
<instance
index=
"0"
>
RTE\Device\BAT32A239KK64FB\system_BAT32A239.c
</instance>
<component
Cclass=
"Device"
Cgroup=
"Startup"
Cvendor=
"Cmsemicon"
Cversion=
"1.0.0"
condition=
"BAT32A239 CMSIS-CORE"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
3
"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
5
"
/>
<targetInfos>
<targetInfo
name=
"HaoJin232"
/>
</targetInfos>
...
...
@@ -1180,7 +1180,7 @@
<file
attr=
"config"
category=
"header"
name=
"Device\Source\userdefine.h"
version=
"1.0.0"
>
<instance
index=
"0"
>
RTE\Device\BAT32A239KK64FB\userdefine.h
</instance>
<component
Cclass=
"Device"
Cgroup=
"Startup"
Cvendor=
"Cmsemicon"
Cversion=
"1.0.0"
condition=
"BAT32A239 CMSIS-CORE"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
3
"
/>
<package
name=
"BAT32A239"
schemaVersion=
"1.4"
url=
"http://www.mcu.com.cn/pack/"
vendor=
"Cmsemicon"
version=
"1.0.
5
"
/>
<targetInfos>
<targetInfo
name=
"HaoJin232"
/>
</targetInfos>
...
...
Firmware/Source/Application/Data_VSpeed/Data_VSpeed.c
View file @
6841750c
...
...
@@ -364,7 +364,7 @@ uint16_t Get_ActualVechileSpeed(void)
uint16_t
Get_DispVechileSpeed
(
void
)
{
uint16_t
Vspeed
=
0
;
if
(
Get_Dis_Unit
()
==
0
)
/* KM */
if
(
Get_Dis_
KM_
Unit
()
==
0
)
/* KM */
{
if
(
DataVSpeedDisp
>=
1200
)
{
...
...
@@ -372,7 +372,7 @@ uint16_t Get_DispVechileSpeed(void)
}
Vspeed
=
DataVSpeedDisp
;
}
else
//if (Get_Dis_Unit() == 1) /* MILE */
else
//if (Get_Dis_
KM_
Unit() == 1) /* MILE */
{
Vspeed
=
Data_Km_To_Mile
(
DataVSpeedDisp
);
if
(
Vspeed
>=
750
)
...
...
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
View file @
6841750c
...
...
@@ -1660,7 +1660,7 @@ _Fun_Res SEG_SET_VSpeed_NUM(uint8_t m_Flag, uint16_t m_NUM)
}
else
{
if
((
Get_Dis_Unit
()
==
1
))
if
((
Get_Dis_
KM_
Unit
()
==
1
))
{
IC1_SEG059
=
IC_SEG_OFF
;
IC1_SEG058
=
IC_SEG_ON
;
...
...
@@ -1988,7 +1988,7 @@ _Fun_Res SEG_SET_ODO_NUM(uint8_t m_Flag, uint32_t m_NUM)
}
else
{
if
(
Get_Dis_Unit
()
==
1
)
if
(
Get_Dis_
KM_
Unit
()
==
1
)
{
IC2_SEG103
=
IC_SEG_OFF
;
IC2_SEG105
=
IC_SEG_ON
;
...
...
@@ -2459,7 +2459,7 @@ _Fun_Res SEG_SET_TRIP_NUM(uint8_t m_Flag, uint16_t m_NUM)
}
else
{
if
(
Get_Dis_Unit
()
==
1
)
if
(
Get_Dis_
KM_
Unit
()
==
1
)
{
IC1_SEG114
=
IC_SEG_OFF
;
IC1_SEG116
=
IC_SEG_ON
;
...
...
Firmware/Source/Component/Key/Key.h
View file @
6841750c
...
...
@@ -17,7 +17,7 @@ typedef unsigned long long Key_uint64_t;
typedef
enum
{
KEY_LEFT
=
0U
,
KEY_RIGHT
,
//
KEY_RIGHT,
// KEY_UP,
// KEY_DOWN,
// KEY_ENTER,
...
...
Firmware/Source/Component/Key/Key_user.c
View file @
6841750c
...
...
@@ -4,12 +4,10 @@
#include "Components.h"
__align
(
4
)
#define BACK_MENU_TIME 1
0
00
#define BACK_MENU_TIME 1
5
00
_Menu_Infor
MenuInfor
;
_Menu_Data
MenuData
;
uint8_t
PageType
;
uint8_t
Key_Right_Long_Press_Flag
;
uint8_t
Key_Left_Long_Press_Flag
;
uint8_t
PageType
=
0
;
RTC_TimeTypeDef
RTC_TimeStruct
;
RTC_DateTypeDef
RTC_DateStruct
;
...
...
@@ -19,20 +17,21 @@ void Key_Operation_Left(Key_Event_en_t enKeyEvent)//Mode
{
switch
(
enKeyEvent
)
{
case
KEY_EVENT_SHORT_PRESS_1
:
case
KEY_EVENT_SHORT_PRESS_1
:
//1s
Key_Left_Short_Press
();
break
;
case
KEY_EVENT_SHORT_PRESS_2
:
break
;
case
KEY_EVENT_LONG_PRESS_1
:
//2
case
KEY_EVENT_SHORT_PRESS_2
:
//3-5s
Key_Left_Long_Press
();
Key_Left_Long_Press_Flag
=
1
;
break
;
case
KEY_EVENT_LONG_PRESS_
2
:
//3
case
KEY_EVENT_LONG_PRESS_
1
:
//7
break
;
case
KEY_EVENT_LONG_PRESS_3
:
//5s
case
KEY_EVENT_LONG_PRESS_2
:
//8
break
;
case
KEY_EVENT_LONG_PRESS_3
:
//9s
break
;
case
KEY_EVENT_LONG_PRESS_4
:
//10s
Maintain_Reset_Service
();
TYW_RESET_ODO
();
break
;
case
KEY_EVENT_OFF_TO_ON
:
break
;
...
...
@@ -40,7 +39,6 @@ void Key_Operation_Left(Key_Event_en_t enKeyEvent)//Mode
break
;
case
KEY_EVENT_NONE
:
KEY_LEFT_EVENT_NONE_Service
();
Key_Left_Long_Press_Flag
=
0
;
break
;
default:
break
;
...
...
@@ -51,28 +49,22 @@ void Key_Operation_Right(Key_Event_en_t enKeyEvent)//Set
switch
(
enKeyEvent
)
{
case
KEY_EVENT_SHORT_PRESS_1
:
Key_Right_Short_Press
();
break
;
case
KEY_EVENT_SHORT_PRESS_2
:
break
;
case
KEY_EVENT_LONG_PRESS_1
:
//2s
Key_Right_Long_Press
();
Key_Right_Long_Press_Flag
=
1
;
case
KEY_EVENT_LONG_PRESS_1
:
break
;
case
KEY_EVENT_LONG_PRESS_2
:
//3s
case
KEY_EVENT_LONG_PRESS_2
:
break
;
case
KEY_EVENT_LONG_PRESS_3
:
//5s
case
KEY_EVENT_LONG_PRESS_3
:
break
;
case
KEY_EVENT_LONG_PRESS_4
:
//10s
TYW_RESET_ODO
();
case
KEY_EVENT_LONG_PRESS_4
:
break
;
case
KEY_EVENT_OFF_TO_ON
:
break
;
case
KEY_EVENT_ON_TO_OFF
:
break
;
case
KEY_EVENT_NONE
:
KEY_RIGHT_EVENT_NONE_Service
();
Key_Right_Long_Press_Flag
=
0
;
break
;
default:
break
;
...
...
@@ -84,33 +76,30 @@ void Key_Operation_Right(Key_Event_en_t enKeyEvent)//Set
Key_Status_en_t
Key_Status_Read_Left
(
void
)
{
Key_Status_en_t
enKeyReal
=
KEY_REALTIME_LOOSEN
;
if
(
SYS_OPR_STAT_IGN_ON
)
if
(
RTE_GPIO_Get_Level
(
MODE_P_IN
)
)
{
//if (RTE_GPIO_Get_Level(MODE_P_IN))
//{
// enKeyReal = KEY_REALTIME_LOOSEN;
//}
//else
//{
// enKeyReal = KEY_REALTIME_PRESS;
//}
enKeyReal
=
KEY_REALTIME_LOOSEN
;
}
else
{
enKeyReal
=
KEY_REALTIME_PRESS
;
}
return
enKeyReal
;
}
Key_Status_en_t
Key_Status_Read_Right
(
void
)
{
Key_Status_en_t
enKeyReal
=
KEY_REALTIME_LOOSEN
;
if
(
SYS_OPR_STAT_IGN_ON
)
{
//
if (RTE_GPIO_Get_Level(SET_P_IN))
//
{
//
if (SYS_OPR_STAT_IGN_ON)
//
{
//
if (RTE_GPIO_Get_Level(SET_P_IN))
//
{
// enKeyReal = KEY_REALTIME_LOOSEN;
//
}
//
else
//
{
//
}
//
else
//
{
// enKeyReal = KEY_REALTIME_PRESS;
//
}
}
//
}
//
}
return
enKeyReal
;
}
...
...
@@ -119,7 +108,7 @@ Key_Status_en_t Key_Status_Read_Right(void)
const
Key_Attribute_st_t
stKeyAttribute
[
KEY_NUM_MAX
]
=
{
{
KEY_NEED_DEBOUNCE_NORMAL
,
Key_Status_Read_Left
,
Key_Operation_Left
},
{
KEY_NEED_DEBOUNCE_NORMAL
,
Key_Status_Read_Right
,
Key_Operation_Right
},
//
{KEY_NEED_DEBOUNCE_NORMAL, Key_Status_Read_Right, Key_Operation_Right},
//{KEY_NEED_DEBOUNCE_NORMAL, Key_Status_Read_FLIP, Key_Operation_FLIP},
//{KEY_NEED_DEBOUNCE_NORMAL, Key_Status_Read_ADJUST, Key_Operation_ADJUST},
};
...
...
@@ -141,11 +130,11 @@ void Key_KL30_Init_EXample(void)
Key_KL30_Init
(
&
u8KeyRamData
[
0
],
stKeyAttribute
,
&
stKeyInitTem
);
Key_Parameter_Set_Short_Press_1_Time
(
50U
,
1000U
);
Key_Parameter_Set_Short_Press_2_Time
(
1500U
,
2
000U
);
Key_Parameter_Set_Short_Press_2_Time
(
3000U
,
5
000U
);
Key_Parameter_Set_Long_Press_1_Time
(
2
000U
);
Key_Parameter_Set_Long_Press_2_Time
(
3
000U
);
Key_Parameter_Set_Long_Press_3_Time
(
5
000U
);
Key_Parameter_Set_Long_Press_1_Time
(
7
000U
);
Key_Parameter_Set_Long_Press_2_Time
(
8
000U
);
Key_Parameter_Set_Long_Press_3_Time
(
9
000U
);
Key_Parameter_Set_Long_Press_4_Time
(
10000U
);
}
void
Key_Wakeup_Init_EXample
(
void
)
...
...
@@ -157,11 +146,11 @@ void Key_Wakeup_Init_EXample(void)
Key_Wakeup_Init
(
&
u8KeyRamData
[
0
],
stKeyAttribute
,
&
stKeyInitTem
);
Key_Parameter_Set_Short_Press_1_Time
(
50U
,
1000U
);
Key_Parameter_Set_Short_Press_2_Time
(
1500U
,
2
000U
);
Key_Parameter_Set_Short_Press_2_Time
(
3000U
,
5
000U
);
Key_Parameter_Set_Long_Press_1_Time
(
2
000U
);
Key_Parameter_Set_Long_Press_2_Time
(
3
000U
);
Key_Parameter_Set_Long_Press_3_Time
(
5
000U
);
Key_Parameter_Set_Long_Press_1_Time
(
7
000U
);
Key_Parameter_Set_Long_Press_2_Time
(
8
000U
);
Key_Parameter_Set_Long_Press_3_Time
(
9
000U
);
Key_Parameter_Set_Long_Press_4_Time
(
10000U
);
}
...
...
@@ -176,15 +165,7 @@ void KEY_LEFT_EVENT_NONE_Service(void)
}
}
void
KEY_RIGHT_EVENT_NONE_Service
(
void
)
{
MenuInfor
.
Back_Time_Right
++
;
if
(
MenuInfor
.
Back_Time_Right
>
BACK_MENU_TIME
)
{
MenuInfor
.
Back_Time_Right
=
BACK_MENU_TIME
;
MenuInfor
.
Back_Time_Right_Flag
=
1
;
}
}
void
Key_Clear_Time
(
void
)
{
...
...
@@ -192,22 +173,12 @@ void Key_Clear_Time(void)
{
MenuInfor
.
Back_Time_Left
=
0
;
MenuInfor
.
Back_Time_Left_Flag
=
0
;
MenuInfor
.
Back_Time_Right_Flag
=
0
;
}
if
(
Key_Status_Read_Right
()
==
KEY_REALTIME_PRESS
)
{
MenuInfor
.
Back_Time_Right
=
0
;
MenuInfor
.
Back_Time_Left_Flag
=
0
;
MenuInfor
.
Back_Time_Right_Flag
=
0
;
}
}
void
Key_Check_Service
(
void
)
{
if
((
Key_Right_Long_Press_Flag
==
1
)
&&
(
Key_Left_Long_Press_Flag
==
1
)
&&
(
PageType
==
Page_Time
))
{
PageType
=
Page_Time_Set_Hour
;
}
}
void
Key_Left_Short_Press
(
void
)
...
...
@@ -216,104 +187,128 @@ void Key_Left_Short_Press(void)
uint8_t
datmax
=
0u
;
uint8_t
datmin
=
0u
;
if
(
PageType
==
Page_Time_Set_Hour
)
if
(
PageType
==
Page_Odo
)
{
PageType
=
Page_Trip
;
}
else
if
(
PageType
==
Page_Trip
)
{
PageType
=
Page_DTC
;
}
else
if
(
PageType
==
Page_DTC
)
{
PageType
=
Page_TCS
;
}
else
if
(
PageType
==
Page_TCS
)
{
PageType
=
Page_Odo
;
}
if
(
PageType
==
Page_Time_Hour
)
{
updataDir
=
1
;
datmax
=
23u
;
datmin
=
0u
;
Menu_u8Data_Updata_Process
(
updataDir
,
datmax
,
datmin
,
1u
,
(
uint8_t
*
)
&
(
counter_val
.
time
.
RTC_Hours
));
}
else
if
(
PageType
==
Page_Time_
Set_
Minute
)
else
if
(
PageType
==
Page_Time_Minute
)
{
updataDir
=
1
;
datmax
=
59u
;
datmin
=
0u
;
Menu_u8Data_Updata_Process
(
updataDir
,
datmax
,
datmin
,
1u
,
(
uint8_t
*
)
&
(
counter_val
.
time
.
RTC_Minutes
));
}
else
if
(
PageType
==
Page_Km_Unit
)
{
if
(
Get_Dis_KM_Unit
()
==
0
)
{
MenuData
.
KM_Unit
=
1
;
//mile
}
else
{
if
((
PageType
==
Page_Time
)
&&
(
Key_Status_Read_Right
()
==
KEY_REALTIME_LOOSEN
)
&&
(
Common_Get_IG_Sts
(
)
==
COMMON_POWER_ON
))
MenuData
.
KM_Unit
=
0
;
//km
}
Unit_Convert_Service
();
}
else
if
(
PageType
==
Page_Tpms_Unit
)
{
if
(
Get_Di
s_Unit
()
==
0
)
if
(
Get_Dis_Tpm
s_Unit
()
==
0
)
{
MenuData
.
Unit
=
1
;
//mile
MenuData
.
Tpms_Unit
=
1
;
//psi
}
else
{
MenuData
.
Unit
=
0
;
//km
}
MenuData
.
Tpms_Unit
=
0
;
//bar
}
Unit_Convert_Service
();
}
else
{
;
}
}
void
Key_Auto_Save
(
void
)
{
if
((
MenuInfor
.
Back_Time_Left_Flag
==
1
)
&&
(
MenuInfor
.
Back_Time_Right_Flag
==
1
)
)
if
((
MenuInfor
.
Back_Time_Left_Flag
==
1
))
{
if
(
PageType
==
Page_Time_
Set_
Hour
)
if
(
PageType
==
Page_Time_Hour
)
{
RTC_SetTime
(
&
counter_val
.
time
);
}
if
(
PageType
==
Page_Time_
Set_
Minute
)
if
(
PageType
==
Page_Time_Minute
)
{
RTC_SetTime
(
&
counter_val
.
time
);
}
PageType
=
Page_
Time
;
PageType
=
Page_
Odo
;
}
}
void
Key_Right_Short_Press
(
void
)
void
Key_Left_Long_Press
(
void
)
{
if
(
PageType
==
Page_
Time_Set_Hour
)
if
(
PageType
==
Page_
Odo
)
{
PageType
=
Page_Time_
Set_Minute
;
PageType
=
Page_Time_
Hour
;
}
else
if
(
PageType
==
Page_Time_
Set_Minute
)
else
if
(
PageType
==
Page_Time_
Hour
)
{
PageType
=
Page_Time_
Set_Hour
;
PageType
=
Page_Time_
Minute
;
}
else
else
if
(
PageType
==
Page_Time_Minute
)
{
;
PageType
=
Page_Km_Unit
;
}
}
void
Key_Left_Long_Press
(
void
)
{
if
((
PageType
==
Page_Time
)
&&
(
Key_Status_Read_Right
()
==
KEY_REALTIME_LOOSEN
))
else
if
(
PageType
==
Page_Km_Unit
)
{
//Telltales_Auto_Start_Stop_Setting()
;
PageType
=
Page_Tpms_Unit
;
}
}
void
Key_Right_Long_Press
(
void
)
{
if
(
PageType
==
Page_Time
)
else
if
(
PageType
==
Page_Tpms_Unit
)
{
if
(
Key_Status_Read_Left
()
==
KEY_REALTIME_LOOSEN
)
{
Data_Clear_Trip_All
();
}
PageType
=
Page_Odo
;
}
else
if
(
PageType
==
Page_Time_Set_Hour
)
else
{
RTC_SetTime
(
&
counter_val
.
time
);
PageType
=
Page_Time
;
;
}
else
if
(
PageType
==
Page_Time_Set_Minute
)
if
(
PageType
==
Page_TCS
)
{
RTC_SetTime
(
&
counter_val
.
time
);
PageType
=
Page_Time
;
if
(
Get_Dis_Tcs_Val
()
==
0
)
{
MenuData
.
Tcs_Val
=
1
;
//on
}
else
{
;
MenuData
.
Tcs_Val
=
0
;
//off
}
}
}
void
Menu_u8Data_Updata_Process
(
uint8_t
updateDir
,
uint8_t
datMax
,
uint8_t
datMin
,
uint8_t
datStep
,
uint8_t
*
dat
)
{
uint8_t
temp
=
*
dat
;
...
...
@@ -360,7 +355,9 @@ void Menu_u8Data_Updata_Process(uint8_t updateDir , uint8_t datMax, uint8_t datM
void
MenuData_Unit_Init
(
void
)
{
MenuData
.
Unit
=
0
;
MenuData
.
KM_Unit
=
0
;
MenuData
.
Tpms_Unit
=
0
;
MenuData
.
Tcs_Val
=
1
;
}
uint8_t
ClearODO_Flag
=
0
;
...
...
@@ -383,6 +380,11 @@ void TYW_RESET_ODO(void)
}
}
void
Maintain_Reset_Service
(
void
)
{
;
}
uint8_t
Get_Dis_Hour_Time
(
void
)
{
return
counter_val
.
time
.
RTC_Hours
;
...
...
@@ -398,7 +400,17 @@ uint8_t Get_Current_PageType(void)
return
PageType
;
}
uint8_t
Get_Dis_Unit
(
void
)
uint8_t
Get_Dis_KM_Unit
(
void
)
{
return
MenuData
.
KM_Unit
;
//0km,1mile
}
uint8_t
Get_Dis_Tpms_Unit
(
void
)
{
return
MenuData
.
Tpms_Unit
;
//0km,1mile
}
uint8_t
Get_Dis_Tcs_Val
(
void
)
{
return
MenuData
.
Unit
;
//0km,1mile
return
MenuData
.
Tcs_Val
;
// 0 off, 1 on
}
\ No newline at end of file
Firmware/Source/Component/Key/Key_user.h
View file @
6841750c
...
...
@@ -8,8 +8,6 @@
typedef
struct
{
uint16_t
Back_Time_Left
;
uint16_t
Back_Time_Right
;
uint8_t
Back_Time_Right_Flag
;
uint8_t
Back_Time_Left_Flag
;
}
_Menu_Infor
;
...
...
@@ -19,27 +17,32 @@ typedef struct
uint8_t
Set_Minute
;
uint8_t
Dis_Hour
;
uint8_t
Dis_Minute
;
uint8_t
Unit
;
uint8_t
KM_Unit
;
// 0 km, 1 mile
uint8_t
Tpms_Unit
;
// 0 bar, 1 psi
uint8_t
Tcs_Val
;
// 0 off, 1 on
}
_Menu_Data
;
typedef
enum
{
Page_Time
=
0
,
Page_Time_Set_Hour
,
Page_Time_Set_Minute
,
Page_Odo
=
0
,
Page_Time_Hour
,
Page_Time_Minute
,
Page_Km_Unit
,
Page_Tpms_Unit
,
Page_Trip
,
Page_DTC
,
Page_TCS
,
Page_Max
,
}
_Page_Type
;
extern
uint8_t
PageType
;
extern
uint8_t
Key_Right_Long_Press_Flag
;
extern
uint8_t
Key_Left_Long_Press_Flag
;
extern
uint8_t
ClearODO_Flag
;
extern
RTC_CounterTypeDef
counter_val
;
extern
void
Key_KL30_Init_EXample
(
void
);
extern
void
Key_Wakeup_Init_EXample
(
void
);
void
KEY_RIGHT_EVENT_NONE_Service
(
void
);
void
KEY_LEFT_EVENT_NONE_Service
(
void
);
void
Key_Operation_Right
(
Key_Event_en_t
enKeyEvent
);
void
Key_Operation_Left
(
Key_Event_en_t
enKeyEvent
);
...
...
@@ -47,8 +50,6 @@ Key_Status_en_t Key_Status_Read_Left(void);
Key_Status_en_t
Key_Status_Read_Right
(
void
);
void
Key_Clear_Time
(
void
);
void
Menu_u8Data_Updata_Process
(
uint8_t
updateDir
,
uint8_t
datMax
,
uint8_t
datMin
,
uint8_t
datStep
,
uint8_t
*
dat
);
void
Key_Right_Long_Press
(
void
);
void
Key_Right_Short_Press
(
void
);
void
Key_Left_Short_Press
(
void
);
void
Key_Left_Long_Press
(
void
);
void
Key_Auto_Save
(
void
);
...
...
@@ -56,7 +57,10 @@ uint8_t Get_Dis_Hour_Time(void);
uint8_t
Get_Dis_Minute_Time
(
void
);
uint8_t
Get_Current_PageType
(
void
);
void
TYW_RESET_ODO
(
void
);
uint8_t
Get_Dis_Unit
(
void
);
uint8_t
Get_Dis_KM_Unit
(
void
);
uint8_t
Get_Dis_Tpms_Unit
(
void
);
uint8_t
Get_Dis_Tcs_Val
(
void
);
void
Key_Check_Service
(
void
);
void
MenuData_Unit_Init
(
void
);
void
Maintain_Reset_Service
(
void
);
#endif
Firmware/Source/Component/Mileage/Services_Mileage_User.c
View file @
6841750c
...
...
@@ -201,11 +201,11 @@ void Services_Mileage_Callback(void)
uint32_t
Get_ODO_Value
(
void
)
{
uint32_t
ODO
=
0
;
if
(
Get_Dis_Unit
()
==
0
)
/* 公制 */
if
(
Get_Dis_
KM_
Unit
()
==
0
)
/* 公制 */
{
ODO
=
Data_ODO_Read
();
}
else
if
(
Get_Dis_Unit
()
==
1
)
/* 英制 */
else
if
(
Get_Dis_
KM_
Unit
()
==
1
)
/* 英制 */
{
ODO
=
Data_Km_To_Mile
(
Data_ODO_Read
());
}
...
...
@@ -223,11 +223,11 @@ uint32_t Get_ODO_Value(void)
uint32_t
Get_Trip_Value
(
void
)
{
uint32_t
Trip
=
0
;
if
(
Get_Dis_Unit
()
==
0
)
/* 公制 */
if
(
Get_Dis_
KM_
Unit
()
==
0
)
/* 公制 */
{
Trip
=
Data_Read_Trip
(
EM_TRIP_A
);
}
else
if
(
Get_Dis_Unit
()
==
1
)
/* 英制 */
else
if
(
Get_Dis_
KM_
Unit
()
==
1
)
/* 英制 */
{
Trip
=
Data_Km_To_Mile
(
Data_Read_Trip
(
EM_TRIP_A
));
}
...
...
@@ -244,7 +244,7 @@ uint32_t testtrip = 0;
*/
void
Trip_Clear_Km_Service
(
void
)
{
if
(
Get_Dis_Unit
()
==
0
)
/* 公制 */
if
(
Get_Dis_
KM_
Unit
()
==
0
)
/* 公制 */
{
if
(
Data_Read_Trip
(
EM_TRIP_A
)
>
9999
)
/* 当前单位在KM时,里程大于999.9KM进行清零 */
{
...
...
@@ -261,13 +261,18 @@ void Trip_Clear_Km_Service(void)
*/
void
Unit_Convert_Service
(
void
)
{
if
(
Get_Dis_Unit
()
==
0
)
/* 公制 */
if
(
Get_Dis_
KM_
Unit
()
==
0
)
/* 公制 */
{
if
(
Data_Read_Trip
(
EM_TRIP_A
)
>
9999
)
/* 当前单位在KM时,里程大于999.9KM进行清零 */
{
Data_Write_Trip
(
EM_TRIP_A
,
9999
);
}
}
if
(
Get_Dis_Tpms_Unit
()
==
0
)
/* bar */
{
;
}
}
...
...
Firmware/Source/System/Sys_Task_List.c
View file @
6841750c
...
...
@@ -69,7 +69,7 @@ void Sys_50ms_Tasks(void)
uint8_t
u8LEDDriverCheckCount
=
0U
;
void
Sys_100ms_Tasks
(
void
)
{
if
(
PageType
==
Page_Time
)
if
(
(
PageType
!=
Page_Time_Hour
)
&&
(
PageType
!=
Page_Time_Minute
)
)
{
RTE_RTC_Get_CounterValue
(
&
counter_val
);
counter_val
.
time
.
RTC_Hours
=
RTC_Bcd2ToByte
(
counter_val
.
time
.
RTC_Hours
);
...
...
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