Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiancetai
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
陈家乐
jiancetai
Commits
2ac46ae9
Commit
2ac46ae9
authored
Feb 04, 2025
by
梁百峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:优化静态电流检测
parent
d966adf5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
91 deletions
+46
-91
Display_Info.c
YueJin_test_bench/source/Appliciation/Display_Info.c
+37
-86
Display_Info.h
YueJin_test_bench/source/Appliciation/Display_Info.h
+3
-1
RTE_GPIO.c
YueJin_test_bench/source/Appliciation/RTE_GPIO.c
+2
-2
init.c
YueJin_test_bench/source/System/init.c
+4
-2
No files found.
YueJin_test_bench/source/Appliciation/Display_Info.c
View file @
2ac46ae9
...
@@ -16,6 +16,7 @@ uint32_t Display_Menu_Type;
...
@@ -16,6 +16,7 @@ uint32_t Display_Menu_Type;
uint32_t
Page_Refresh
=
1
;
uint32_t
Page_Refresh
=
1
;
uint32_t
PageNum_history
=
0xff
;
uint32_t
PageNum_history
=
0xff
;
uint16_t
Fuel_Res
;
uint16_t
Fuel_Res
;
uint32_t
loc_Current_0
=
0
;
//const uint16_t BackLightDigitNum09PosX[] = {30*9, 30*8, 30*7, 30*6, 30*5, 30*4, 30*3, 30*2, 30*1, 30*0};
//const uint16_t BackLightDigitNum09PosX[] = {30*9, 30*8, 30*7, 30*6, 30*5, 30*4, 30*3, 30*2, 30*1, 30*0};
const
unsigned
char
gImage_titlex0_y0
[]
=
{
/*Byte Size322*/
const
unsigned
char
gImage_titlex0_y0
[]
=
{
/*Byte Size322*/
80U
,
32U
,
80U
,
32U
,
...
@@ -3527,16 +3528,16 @@ void HW_Voltage_Check(uint32_t cmd)
...
@@ -3527,16 +3528,16 @@ void HW_Voltage_Check(uint32_t cmd)
}
}
const
uint16_t
CurrentDigitNum09PosX
[]
=
{
200
,
180
,
170
};
const
uint16_t
CurrentDigitNum09PosX
[]
=
{
200
,
180
,
170
};
#define Sampling_NUM
15
#define Sampling_NUM
2000
uint32_t
dianliu
;
uint32_t
dianliu
;
static
uint32_t
loc_ret1
=
0
;
void
HW_Static_Current_Check
(
uint32_t
cmd
)
void
HW_Static_Current_Check
(
uint32_t
cmd
)
{
{
uint8_t
p
[
20
];
uint8_t
p
[
20
];
uint32_t
loc_Current_0
=
0
;
uint32_t
loc_Current_1
=
0
;
uint32_t
loc_Current_1
=
0
;
static
uint32_t
loc_Timer
=
0
;
static
uint32_t
loc_ret
=
0
;
if
(
cmd
==
0u
)
if
(
cmd
==
0u
)
{
{
...
@@ -3548,13 +3549,42 @@ void HW_Static_Current_Check(uint32_t cmd)
...
@@ -3548,13 +3549,42 @@ void HW_Static_Current_Check(uint32_t cmd)
TFT_LCD_Draw_Bmp
(
3
,
60
,
(
uint8_t
*
)
gImage_Dyy_words_5X6_Y137
);
TFT_LCD_Draw_Bmp
(
3
,
60
,
(
uint8_t
*
)
gImage_Dyy_words_5X6_Y137
);
TFT_LCD_Draw_Bmp
(
210
,
60
,
(
uint8_t
*
)
gImage_Dyy_words_18X210_Y139
);
TFT_LCD_Draw_Bmp
(
210
,
60
,
(
uint8_t
*
)
gImage_Dyy_words_18X210_Y139
);
//电流 *0.25 *100 = 电压
//电流 *0.25 *100 = 电压
loc_Current_0
=
ADC_Read_Signal
(
ADC_CH_KL15_VOLTAGE
);
//静态电流:电压/25
//
loc_Current_0 = ADC_Read_Signal(ADC_CH_KL15_VOLTAGE);//静态电流:电压/25
dianliu
=
loc_Current_0
;
dianliu
=
loc_Current_0
;
// loc_ret += loc_Current_0;
// loc_Timer++;
// if ( loc_Timer >= Sampling_NUM )
// {
// loc_Timer = 0;
// loc_ret /= Sampling_NUM;
// // loc_ret *= 1000;//单位0.001毫伏
// // loc_ret /= 100;//转化为电流,单位0.001毫安
// loc_ret /= 10;//单位0.1毫安
if
(
loc_ret1
!=
0
)
{
TFT_LCD_Draw_Bmp
(
190
,
60
,
(
uint8_t
*
)
gImage_Number_15_white_PiontX0_Y0
);
GUI_General_Digit_Display
(
loc_ret1
,
Num_15
,
3
,
0
,
CurrentDigitNum09PosX
,
60
);
loc_ret1
=
0
;
}
// loc_ret = 0;
// }
}
}
void
Get_static_Current
(
void
)
{
static
uint32_t
loc_Timer
=
0
;
static
uint32_t
loc_ret
=
0
;
if
(
MENU_CHECK_STEP
==
13
)
{
loc_Current_0
=
ADC_Read_Signal
(
ADC_CH_KL15_VOLTAGE
);
loc_ret
+=
loc_Current_0
;
loc_ret
+=
loc_Current_0
;
loc_Timer
++
;
loc_Timer
++
;
if
(
loc_Timer
>=
Sampling_NUM
)
if
(
loc_Timer
>=
Sampling_NUM
)
{
{
loc_Timer
=
0
;
loc_Timer
=
0
;
...
@@ -3563,14 +3593,10 @@ void HW_Static_Current_Check(uint32_t cmd)
...
@@ -3563,14 +3593,10 @@ void HW_Static_Current_Check(uint32_t cmd)
// loc_ret *= 1000;//单位0.001毫伏
// loc_ret *= 1000;//单位0.001毫伏
// loc_ret /= 100;//转化为电流,单位0.001毫安
// loc_ret /= 100;//转化为电流,单位0.001毫安
loc_ret
/=
10
;
//单位0.1毫安
loc_ret
/=
10
;
//单位0.1毫安
loc_ret1
=
loc_ret
;
TFT_LCD_Draw_Bmp
(
190
,
60
,
(
uint8_t
*
)
gImage_Number_15_white_PiontX0_Y0
);
GUI_General_Digit_Display
(
loc_ret
,
Num_15
,
3
,
0
,
CurrentDigitNum09PosX
,
60
);
loc_ret
=
0
;
}
}
}
}
}
}
const
uint16_t
testNum
[]
=
{
200
,
190
,
180
};
const
uint16_t
testNum
[]
=
{
200
,
190
,
180
};
void
Check_PWM
(
void
)
void
Check_PWM
(
void
)
...
@@ -3717,81 +3743,6 @@ void Display_Version_Info(uint32_t ON_OFF)
...
@@ -3717,81 +3743,6 @@ void Display_Version_Info(uint32_t ON_OFF)
uint8_t
mbuff
[
4
]
=
{
1
,
0
,
1
,
0xff
};
uint8_t
mbuff
[
4
]
=
{
1
,
0
,
1
,
0xff
};
General_Number_Disp
(
mbuff
,
160
,
290
);
General_Number_Disp
(
mbuff
,
160
,
290
);
// if ( display_Check01 != 7 )
// {
// if ( SW_Version [ 0 ] != 255 )
// {
// SW_Version__Display();
// display_Check01++;
// }
// else
// {
// display_Check01 = 0U;
// }
// }
// if ( display_Check02 != 7 )
// {
// if ( HW_Version [ 0 ] != 255 )
// {
// HW_Version__Display();
// display_Check02++;
// }
// else
// {
// display_Check02 = 0U;
// }
// }
// if ( display_Check03 != 7 )
// {
// if ( Part_Version [ 0 ] != 255 )
// {
// Part_Version__Display();
// display_Check03++;
// }
// else
// {
// display_Check03 = 0U;
// }
// }
//if ( display_Check04 != 7 )
//{
// if ( Made_Date [ 0 ] != 255 )
// {
// Made_Date__Display();
// display_Check04++;
// }
// else
// {
// display_Check04 = 0U;
// }
//}
// if ( display_Check05 != 7 )
// {
// if ( SUPPLIER [ 0 ] != 255 )
// {
// SUPPLIER__Display();
// display_Check05++;
// }
// else
// {
// display_Check05 = 0U;
// }
// }
// HW_Voltage_Check(1);
// Voltage_UDS [0] = 1;
// Voltage_UDS [1] = 2;
// Voltage_UDS [2] = 3;
// Voltage_UDS [3] = 4;
// Voltage_UDS [4] = 5;
// Voltage_UDS [5] = 6;
// Voltage_UDS [6] = 7;
// Voltage_UDS [7] = 8;
// Voltage_UDS__Display();
// //FUEL_UDS__Display(1);
// Check_PWM();
}
}
...
...
YueJin_test_bench/source/Appliciation/Display_Info.h
View file @
2ac46ae9
...
@@ -93,6 +93,8 @@ extern const uint8_t *Num_30[];
...
@@ -93,6 +93,8 @@ extern const uint8_t *Num_30[];
extern
const
uint8_t
*
Letter_Num_11
[];
extern
const
uint8_t
*
Letter_Num_11
[];
extern
uint32_t
loc_Current_0
;
extern
void
Get_static_Current
(
void
);
extern
const
uint8_t
*
Num_15
[];
#define PCodeText_Space_size 2//故障文字 英文空格的像素数
#define PCodeText_Space_size 2//故障文字 英文空格的像素数
#endif
#endif
YueJin_test_bench/source/Appliciation/RTE_GPIO.c
View file @
2ac46ae9
...
@@ -101,11 +101,11 @@ void RTE_GPIO_Init(void)
...
@@ -101,11 +101,11 @@ void RTE_GPIO_Init(void)
gpio_temp
.
enGPIODir
=
GPIO_DIR_IN
;
gpio_temp
.
enGPIODir
=
GPIO_DIR_IN
;
gpio_temp
.
enGPIOAltFun
=
GPIO_ALTER_FUN_1
;
gpio_temp
.
enGPIOAltFun
=
GPIO_ALTER_FUN_1
;
GPIO_Config
(
&
gpio_temp
);
GPIO_Config
(
&
gpio_temp
);
queren
=
0
;
LINE_OUT_NEG_01
=
1
;
LINE_OUT_NEG_01
=
1
;
LINE_OUT_NEG_02
=
1
;
LINE_OUT_NEG_02
=
1
;
LINE_OUT_NEG_03
=
1
;
LINE_OUT_NEG_03
=
1
;
LINE_OUT_NEG_04
=
1
;
LINE_OUT_NEG_04
=
1
;
queren
=
0
;
#if(0)
#if(0)
gpio_temp
.
enGPIOPort
=
GPIO_PORT_GROUP_0
;
gpio_temp
.
enGPIOPort
=
GPIO_PORT_GROUP_0
;
...
...
YueJin_test_bench/source/System/init.c
View file @
2ac46ae9
...
@@ -74,8 +74,8 @@ void Sys_Startup_Init(void)
...
@@ -74,8 +74,8 @@ void Sys_Startup_Init(void)
GPIO_SET_KEPP
(
);
GPIO_SET_KEPP
(
);
RTE_ADC_Init
(
);
RTE_ADC_Init
(
);
COM_CAN_Init
(
);
//
COM_CAN_Init( );
Can_Init
(
);
//
Can_Init( );
enable_interrupt
(
);
enable_interrupt
(
);
Sys_Tick_Timer_Start
(
);
Sys_Tick_Timer_Start
(
);
TFT_LCD_Startup
(
);
TFT_LCD_Startup
(
);
...
@@ -104,6 +104,8 @@ void Sys_Startup_Init(void)
...
@@ -104,6 +104,8 @@ void Sys_Startup_Init(void)
loc_config
.
pfnUARTErrHandleCallBack
=
0
;
loc_config
.
pfnUARTErrHandleCallBack
=
0
;
loc_config
.
pfnUARTReadMsgCallBack
=
UART_Put1
;
loc_config
.
pfnUARTReadMsgCallBack
=
UART_Put1
;
UART_Init
(
UART_RLIN31
,
&
loc_config
);
UART_Init
(
UART_RLIN31
,
&
loc_config
);
Auto_ONOFF
=
1
;
AutoFlag
=
1
;
}
}
/***********************************************************************
/***********************************************************************
...
...
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