Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
RT_RMR42E
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
时昊
RT_RMR42E
Commits
ab5a58eb
Commit
ab5a58eb
authored
Jun 28, 2024
by
郑萍
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:电源模式切换到Key_ACC自检
parent
a438ed2b
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
606 additions
and
561 deletions
+606
-561
BackLight.c
Firmware/Source/Application/BackLight/BackLight.c
+2
-2
CAN_CH0_CAN_Communication_Matrix.c
...ce/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
+32
-0
CAN_CH0_CAN_Communication_Matrix.h
...ce/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.h
+13
-0
CommonInterface.c
...ware/Source/Application/CommonInterface/CommonInterface.c
+30
-33
GUI_Display.c
Firmware/Source/Application/GUI_Display/GUI_Display.c
+55
-75
SEG_DISPLAY.c
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
+402
-385
PowerManag_user.c
Firmware/Source/Component/PowerManagement/PowerManag_user.c
+1
-0
Telltales_user.c
Firmware/Source/Component/Telltales/Telltales_user.c
+69
-49
Sys_Task_List.c
Firmware/Source/System/Sys_Task_List.c
+1
-16
main.c
Firmware/Source/System/main.c
+1
-1
No files found.
Firmware/Source/Application/BackLight/BackLight.c
View file @
ab5a58eb
...
...
@@ -9,7 +9,7 @@
uint8_t
interact_PWM_Low_Duty
=
0
;
void
BackLight_Process
(
void
)
{
if
(
SYS_OPR_STAT_IGN_ON
)
if
(
Get_CAN_Power_State
()
!=
PKEY_ON
&&
Get_CAN_Power_State
()
!=
KEY_OFF
)
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER1
,
TIMERM_CHB
,
BACK_LIGHT_DAY
);
}
...
...
@@ -21,7 +21,7 @@ void BackLight_Process(void)
void
Interact_Light_Process
(
void
)
{
if
(
SYS_OPR_STAT_IGN_ON
)
if
(
Get_CAN_Power_State
()
!=
PKEY_ON
&&
Get_CAN_Power_State
()
!=
KEY_OFF
)
{
TimerM_PWM_set_duty
(
TIMERM_COUNTER0
,
TIMERM_CHD
,
interact_PWM_Low_Duty
*
10
);
}
...
...
Firmware/Source/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.c
View file @
ab5a58eb
...
...
@@ -173,6 +173,38 @@ void System_Indicator_OFF_callback(void)
{
System_Indicator_CANFlag
=
1
;
}
uint8_t
Get_CAN_Power_State
(
void
)
{
uint8_t
state
=
0
;
uint8_t
Signal1
=
Get_CAN_CH0_ID_125_Sig_MMCU_PowerMode
();
switch
(
Signal1
)
{
case
0x0
:
state
=
KEY_OFF
;
break
;
case
0x1
:
state
=
PKEY_ON
;
break
;
case
0x2
:
state
=
KEY_ACC
;
break
;
case
0x3
:
state
=
READY
;
break
;
case
0x4
:
state
=
CHRG_PLUGIN
;
break
;
case
0x5
:
state
=
CHRGING
;
break
;
case
0x6
:
state
=
CHRGEND
;
break
;
default:
break
;
}
return
state
;
}
uint8_t
Get_CAN_CH0_ID_393_Sig_ICU_ProtoSubVer
(
void
)
{
return
(((
uint8_t
)((
uint8_t
)
CAN_MSG_Read
(
CAN_CH0
,
CAN_CH0_ID_CAN_0x393_Msg_Count
,
6u
)
>>
0u
)
&
0xFFu
));
...
...
Firmware/Source/Application/CAN_APP/CAN_CH0_CAN_Communication_Matrix.h
View file @
ab5a58eb
...
...
@@ -30,6 +30,18 @@ typedef enum
CAN_CH0_ID_TOTAL_MAX
,
}
CAN_CH0_CAN_MSG_ID_t
;
typedef
enum
{
KEY_OFF
=
0
,
PKEY_ON
,
KEY_ACC
,
READY
,
CHRG_PLUGIN
,
CHRGING
,
CHRGEND
,
}
POWER_CHECK_STATE_t
;
typedef
enum
{
...
...
@@ -125,5 +137,6 @@ extern uint8_t Co_Can_ConvertSubID_CAN_CH0(uint32_t MsgID);
extern
uint8_t
System_Indicator_CANFlag
;
void
System_Indicator_ON_callback
(
void
);
void
System_Indicator_OFF_callback
(
void
);
extern
uint8_t
Get_CAN_Power_State
(
void
);
#endif
Firmware/Source/Application/CommonInterface/CommonInterface.c
View file @
ab5a58eb
#include "CommonInterface\CommonInterface.h"
#include "CAN_APP\CAN_CH0_CAN_Communication_Matrix.h"
static
uint32_t
PowerIgnOnTimeLine
;
uint32_t
PowerIgnOffTimeLine
;
uint32_t
PowerIgnOffTimeLine
;
uint8_t
Power_CheckSelf
=
0
;
static
uint32_t
PowerSocTimeLine
;
static
COMMON_PowerStatus_t
PowerSts
;
/*1 ON ; 0 OFF*/
...
...
@@ -50,7 +51,7 @@ uint16_t Common_Get_Act_V_Speed_ODO(void)
// uint16_t Common_Get_Disp_V_Speed(void)
// {
// return Disp_V_Speed;
// }
// }
uint16_t
Common_Get_TireSize
(
void
)
{
...
...
@@ -106,27 +107,31 @@ void Common_Input_Para(void)
{
if
(
SYS_OPR_STAT_IGN_ON
)
{
Common_Set_IG_Sts
(
COMMON_POWER_ON
);
Common_Set_IG_Sts_Valid
(
COMMON_Valid
);
if
((
Get_CAN_Power_State
()
!=
KEY_OFF
))
{
Common_Set_IG_Sts
(
COMMON_POWER_ON
);
Common_Set_IG_Sts_Valid
(
COMMON_Valid
);
// Common_Set_Act_V_Speed(Get_ActualVechileSpeed());
// Common_Set_Disp_V_Speed(Get_DispVechileSpeed());
// if (Get_VechileSpeedValid() == COMMON_Valid)
// {
// Common_Set_Act_V_Speed_Valid(COMMON_Valid);
// Common_Set_Disp_V_Speed_Valid(COMMON_Valid);
// }
// else
// {
// Common_Set_Act_V_Speed_Valid(COMMON_InValid);
// Common_Set_Disp_V_Speed_Valid(COMMON_InValid);
// }
PowerIgnOffTimeLine
=
0ul
;
if
(
PowerIgnOnTimeLine
<
0x7ffffffful
)
PowerIgnOffTimeLine
=
0ul
;
if
(
PowerIgnOnTimeLine
<
0x7ffffffful
)
{
PowerIgnOnTimeLine
+=
2u
;
}
}
else
{
PowerIgnOnTimeLine
=
0ul
;
if
(
PowerIgnOffTimeLine
<
0x7ffffffful
)
{
PowerIgnOffTimeLine
+=
2u
;
}
Common_Set_IG_Sts
(
COMMON_POWER_OFF
);
Common_Set_IG_Sts_Valid
(
COMMON_Valid
);
}
if
((
Get_CAN_Power_State
()
==
PKEY_ON
))
{
PowerIgnOnTimeLine
+=
2u
;
PowerIgnOnTimeLine
=
0ul
;
}
}
else
...
...
@@ -138,10 +143,6 @@ void Common_Input_Para(void)
}
Common_Set_IG_Sts
(
COMMON_POWER_OFF
);
Common_Set_IG_Sts_Valid
(
COMMON_Valid
);
// /*车转真实值OFF为0*/
// Common_Set_Act_V_Speed(0u);
// Common_Set_Disp_V_Speed(0u);
}
}
...
...
@@ -160,16 +161,14 @@ uint32_t Common_GetSocTime(void)
return
PowerSocTimeLine
;
}
/**
* @brief 公里转换英里
* @return 公里
*/
uint32_t
Data_Km_To_Mile
(
uint32_t
Km
)
{
//Km *= 621;
//Km /= 1000;
{
//
Km *= 621;
//
Km /= 1000;
Km
*=
100
;
Km
/=
161
;
return
Km
;
...
...
@@ -184,5 +183,3 @@ uint32_t Data_Mile_To_Km(uint32_t Mile)
Mile
/=
100
;
return
Mile
;
}
Firmware/Source/Application/GUI_Display/GUI_Display.c
View file @
ab5a58eb
#include "GUI_Display\GUI_Display.h"
#include "SEG_DISPLAY\SEG_DISPLAY.h"
#include "SEG_DISPLAY\SEG_DISPLAY.h"
#include "Application.h"
uint8_t
SOC_1_Flag_Count
=
0
;
...
...
@@ -49,7 +49,7 @@ uint8_t SOC_2_Count = 0;
// }
// }
// }
// }
// void Gauge_Power_2_SOC_Display(void)
// {
...
...
@@ -103,7 +103,7 @@ uint8_t SOC_2_Count = 0;
// VSpeedDisplayValue = 0u;
// SEG_SET_VSpeed_NUM(0u, 0u);
// }
// }
void
Gauge_Clock_Display
(
void
)
{
...
...
@@ -111,7 +111,7 @@ void Gauge_Clock_Display(void)
// if (Common_Get_IG_Sts( ) == COMMON_POWER_ON)
// {
// // PageType_DIS = Get_Current_PageType();
// if ( PageType_DIS == 1 )
// {
// if(FLASH_SYNC_1Hz)
...
...
@@ -122,7 +122,7 @@ void Gauge_Clock_Display(void)
// {
// SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), 1, 0, 1);
// }
// }
// else if ( PageType_DIS == 2 )
// {
...
...
@@ -135,7 +135,7 @@ void Gauge_Clock_Display(void)
// SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), 1, 1, 0);
// }
// }
// else
// else
// {
// SEG_SET_Clock(Get_Dis_Hour_Time(), Get_Dis_Minute_Time(), FLASH_SYNC_1Hz, 1, 1);
// }
...
...
@@ -148,9 +148,9 @@ void Gauge_Clock_Display(void)
void
Gauge_Trip_Display
(
void
)
{
if
(
Common_Get_IG_Sts
(
)
==
COMMON_POWER_ON
)
{
SEG_SET_TRIP_NUM
(
1u
,
Get_Trip_Value
());
if
(
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
{
SEG_SET_TRIP_NUM
(
1u
,
Get_Trip_Value
());
}
else
{
...
...
@@ -160,7 +160,7 @@ void Gauge_Trip_Display(void)
void
Gauge_ODO_Display
(
void
)
{
if
(
Common_Get_IG_Sts
(
)
==
COMMON_POWER_ON
)
if
(
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
{
SEG_SET_ODO_NUM
(
1u
,
Get_ODO_Value
()
/
10u
);
}
...
...
@@ -171,7 +171,7 @@ void Gauge_ODO_Display(void)
}
void
Gauge_EspeedDial_Display
(
void
)
{
if
(
Common_Get_IG_Sts
(
)
==
COMMON_POWER_ON
)
if
(
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
{
// SEG_SET_EspeedDial(1, Get_DispEngineSpeed()/1000, Get_DispEngineSpeed());
}
...
...
@@ -181,8 +181,8 @@ void Gauge_EspeedDial_Display(void)
}
}
void
Gauge_Frame_Display
(
void
)
{
if
(
Common_Get_IG_Sts
(
)
==
COMMON_POWER_ON
)
{
if
(
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
{
SEG_SET_Frame
(
1
);
}
...
...
@@ -192,98 +192,78 @@ void Gauge_Frame_Display(void)
}
}
void
Clear_Bu98
(
void
)
{
uint8_t
i
=
0
;
for
(
i
=
0
;
i
<
BU98R10_DDRAM_SIZE
;
i
++
)
for
(
i
=
0
;
i
<
BU98R10_DDRAM_SIZE
;
i
++
)
{
BU98R10Chip0DDRAM
.
Byte
[
i
]
=
0
;
BU98R10Chip1DDRAM
.
Byte
[
i
]
=
0
;
}
}
void
Gauge_Service
(
void
)
{
static
uint16_t
VSpeed_Count
=
0u
;
Gauge_Frame_Display
();
uint8_t
i
=
0
;
Gauge_Frame_Display
();
if
(
0
)
{
if
(
Common_Get_IG_Sts
(
)
==
COMMON_POWER_ON
)
if
(
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
)
{
Check_SEG_Display
();
Check_SEG_Display
();
}
else
{
Clear_Bu98
();
// RTE_GPIO_Set_Level(VSPEED_TEN_OUT, 0);
// RTE_GPIO_Set_Level(VSPEED_HUNDREDS_OUT, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_Normal_Voltage, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_High_Low_Voltage, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, 0);
}
}
else
{
if
(
Common_Get_IG_Sts
(
)
==
COMMON_POWER_ON
)
if
(
Common_Get_IG_Sts
()
==
COMMON_POWER_ON
&&
ADC_Read_Signal
(
ADC_CH_KL30_VOLTAGE
)
<=
16000
&&
ADC_Read_Signal
(
ADC_CH_KL30_VOLTAGE
)
>=
9000
)
{
if
(
Common_GetIgnOnTime
()
>=
3000
)
if
(
Get_CAN_Power_State
()
!=
PKEY_ON
)
{
// Gauge_Power_1_SOC_Display();
// Gauge_Power_2_SOC_Display();
Gauge_ODO_Display
();
Gauge_Clock_Display
();
Gauge_Trip_Display
();
Gauge_EspeedDial_Display
();
SEG_SET_Clock
(
22
,
22
,
1
,
1
,
1
);
SEG_SET_Fault_Code
(
1
,
2222
);
SEG_SET_EleDial
(
1
,
10
,
22
);
SEG_SET_FuelDial
(
1
,
8
);
SEG_SET_GEAR
(
1
,
1
);
SEG_SET_Cutterhead
(
1
,
2
);
SEG_SET_LED_STS
(
0
,
1
);
SEG_SET_LED_STS
(
1
,
1
);
SEG_SET_LED_STS
(
2
,
1
);
SEG_SET_LED_STS
(
3
,
1
);
SEG_SET_LED_STS
(
4
,
1
);
SEG_SET_LED_STS
(
5
,
1
);
SEG_SET_LED_STS
(
6
,
1
);
SEG_SET_LED_STS
(
7
,
1
);
SEG_SET_LED_STS
(
8
,
1
);
SEG_SET_LED_STS
(
9
,
1
);
SEG_SET_LED_STS
(
10
,
1
);
SEG_SET_LED_STS
(
11
,
1
);
SEG_SET_LED_STS
(
12
,
1
);
SEG_SET_LED_STS
(
13
,
1
);
SEG_SET_LED_STS
(
14
,
1
);
SEG_SET_LED_STS
(
15
,
1
);
SEG_SET_LED_STS
(
16
,
1
);
SEG_SET_LED_STS
(
17
,
1
);
SEG_SET_LED_STS
(
18
,
1
);
SEG_SET_Frame
(
1
);
if
(
Common_GetIgnOnTime
()
>=
3000
)
{
// Gauge_Power_1_SOC_Display();
// Gauge_Power_2_SOC_Display();
Checkself_Init
();
Gauge_ODO_Display
();
Gauge_Clock_Display
();
Gauge_Trip_Display
();
Gauge_EspeedDial_Display
();
SEG_SET_Clock
(
22
,
22
,
1
,
1
,
1
);
SEG_SET_Fault_Code
(
0
,
2222
);
SEG_SET_EleDial
(
1
,
10
,
22
);
SEG_SET_FuelDial
(
0
,
8
);
SEG_SET_GEAR
(
1
,
1
);
SEG_SET_Cutterhead
(
1
,
2
);
SEG_SET_Frame
(
1
);
interact_PWM_Low_Duty
=
0
;
}
else
{
Checkself_SEG_Display
();
}
}
else
{
Checkself_SEG_Display
();
{
// Clear_Bu98();
// for (i = 0; i < LampCh0_MAX; i++)
// {
// LED_Driver_Channel_Set(LampChannel_0, i, LED_OFF);
// }
interact_PWM_Low_Duty
=
50
;
//蜂鸣器
}
}
else
{
Clear_Bu98
();
// RTE_GPIO_Set_Level(VSPEED_TEN_OUT, 0);
// RTE_GPIO_Set_Level(VSPEED_HUNDREDS_OUT, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_29_MPH, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_30_KM_H, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_07_Key_ISTOP, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_02_Normal_Voltage, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_03_High_Low_Voltage, 0);
// LED_Driver_Channel_Set(LampChannel_0, LampCh0_06_Screen_Time, 0);
for
(
i
=
0
;
i
<
LampCh0_MAX
;
i
++
)
{
LED_Driver_Channel_Set
(
LampChannel_0
,
i
,
LED_OFF
);
}
}
}
}
}
Firmware/Source/Application/SEG_DISPLAY/SEG_DISPLAY.c
View file @
ab5a58eb
This diff is collapsed.
Click to expand it.
Firmware/Source/Component/PowerManagement/PowerManag_user.c
View file @
ab5a58eb
...
...
@@ -53,6 +53,7 @@ static void Power_KL30_Init(void)
Checkself_Init
();
LINE_IN_Init
();
LED_Driver_Init_Example
();
//注意顺序2
LED_Driver_Service_Immediate
();
Data_User_Mileage_KL30Init
();
TimerM_PWM_counter_Output_Init
(
TIMERM_COUNTER0
,
400
,
64000000
);
TimerM_PWM_counter_Output_Init
(
TIMERM_COUNTER1
,
400
,
64000000
);
...
...
Firmware/Source/Component/Telltales/Telltales_user.c
View file @
ab5a58eb
This diff is collapsed.
Click to expand it.
Firmware/Source/System/Sys_Task_List.c
View file @
ab5a58eb
...
...
@@ -21,15 +21,6 @@ void Sys_2ms_Tasks(void)
Sys_Status_Update_Service
();
Analog_Signal_Conv_Service
();
CanMSg_XMS_Analysis
(
&
CAN_CH0_CanMsgOp
,
2u
);
// if (RTE_GPIO_Get_Level(VSPEED_TEN_OUT))
// {
// RTE_GPIO_Config(VSPEED_TEN_OUT, RTE_GPIO_DIR_OUT|RTE_GPIO_LEVEL_LOW);
// }
// else
// {
// RTE_GPIO_Config(VSPEED_TEN_OUT, RTE_GPIO_DIR_OUT|RTE_GPIO_LEVEL_HIGH);
// }
}
void
Sys_5ms_Tasks
(
void
)
...
...
@@ -66,15 +57,9 @@ void Sys_50ms_Tasks(void)
uint8_t
u8LEDDriverCheckCount
=
0U
;
void
Sys_100ms_Tasks
(
void
)
{
// if(PageType == Page_Time)
// {
// RTE_RTC_Get_CounterValue(&counter_val);
// counter_val.time.RTC_Hours = RTC_Bcd2ToByte(counter_val.time.RTC_Hours);
// counter_val.time.RTC_Minutes = RTC_Bcd2ToByte(counter_val.time.RTC_Minutes);
// }
BackLight_Process
();
Interact_Light_Process
();
// Services_Mileage_Callback();
S3_ServerCNTT
();
if
(
u8LEDDriverCheckCount
>=
10U
)
...
...
Firmware/Source/System/main.c
View file @
ab5a58eb
...
...
@@ -40,7 +40,7 @@
#include "cgc.h"
#include "userdefine.h"
#include "Components.h"
/**
* @brief Main program.
*/
...
...
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