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
83359f75
Commit
83359f75
authored
Nov 07, 2024
by
梁百峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat:雅迪检测台第一版程序
parent
4c51e01f
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
360 additions
and
331 deletions
+360
-331
R485_Communication_Matrix.c
source/R485_Communication_Matrix.c
+26
-13
api_RS485.c
source/api_RS485.c
+2
-1
api_adc.c
source/app/api_adc/api_adc.c
+7
-7
io_config.c
source/app/api_gpio/io_config.c
+27
-18
io_config.h
source/app/api_gpio/io_config.h
+11
-11
adc12b_driver.c
source/bsp_source/bsp_adc/adc12b_driver.c
+1
-1
bsp_app_AUTO.c
source/bsp_source/bsp_button/bsp_app_AUTO.c
+2
-1
bsp_app_led_output.c
source/bsp_source/bsp_button/bsp_app_led_output.c
+236
-236
bsp_button.c
source/bsp_source/bsp_button/bsp_button.c
+27
-26
bsp_motor.c
source/bsp_source/bsp_motor/bsp_motor.c
+15
-15
main.c
source/main.c
+6
-2
No files found.
source/R485_Communication_Matrix.c
View file @
83359f75
...
...
@@ -3,6 +3,7 @@
void
R485_Send_0x40
(
void
)
{
memset
(
R485_ID40h
.
Msg
,
0xFF
,
64
);
// R485_ID40h.Sig.AlarmStatus = 0; // 报警器报警状态
switch
(
HJ_OtherKeyCurrent
.
count
)
{
case
0
:
...
...
@@ -45,7 +46,10 @@ void R485_Send_0x41(void)
R485_ID41h
.
Sig
.
CartMode
=
0
;
R485_ID41h
.
Sig
.
ReverseMode
=
0
;
R485_ID41h
.
Sig
.
RecuperationStatusFeedback
=
0
;
// R485_ID41h.Sig.AlarmStatus = 0; // 报警器报警状态
R485_ID41h
.
Sig
.
IOTRealTime_Year
=
0x1
;
//时间:年
R485_ID41h
.
Sig
.
IOTRealTime_Month
=
0x1
;
//时间:月
R485_ID41h
.
Sig
.
IOTRealTime_Day
=
0x1
;
//时间:日
switch
(
HJ_OtherKeyCurrent
.
count
)
{
case
0
:
...
...
@@ -189,7 +193,7 @@ void R485_Send_0x41(void)
R485_ID41h
.
Sig
.
RotorLocked
=
0
;
break
;
case
3
:
R485_ID41h
.
Sig
.
EleHeadlightFunctionSettings
=
0x
0
;
// 自动大灯
R485_ID41h
.
Sig
.
EleHeadlightFunctionSettings
=
0x
1
;
// 自动大灯
R485_ID41h
.
Sig
.
ChargeState
=
0x0
;
//充电状态
R485_ID41h
.
Sig
.
SlopePattern
=
0x0
;
//跛行
R485_ID41h
.
Sig
.
CushionSensorStatus
=
0x1
;
//坐垫压力
...
...
@@ -252,8 +256,9 @@ void R485_Send_0x41(void)
R485_ID41h
.
Sig
.
ICMCalculatesVehicleSpeed
=
0xE2
;
//速度 = (X * 0.512 * 3.14 * 1.05) / 30 33km
R485_ID41h
.
Sig
.
TotalBatterySOC
=
0x42
;
//电量
R485_ID41h
.
Sig
.
VehicleStatus
=
0x3
;
//整车状态
R485_ID41h
.
Sig
.
SpeedGear
=
0x0
;
//挡位
//功率暂空一会做
R485_ID41h
.
Sig
.
SpeedGear
=
0x1
;
//挡位
R485_ID41h
.
Sig
.
IOTRealTime_Hour
=
0xD
;
//时间:时
R485_ID41h
.
Sig
.
IOTRealTime_Minute
=
0x21
;
//时间:分
R485_ID41h
.
Sig
.
IOTRealTime_Second
=
0
;
//时间:秒
...
...
@@ -295,12 +300,13 @@ void R485_Send_0x41(void)
R485_ID41h
.
Sig
.
SupportSwitchSignalFeedback
=
0x0
;
//边撑
R485_ID41h
.
Sig
.
CruiseMode
=
0x0
;
//巡航
R485_ID41h
.
Sig
.
RecuperationStatusFeedback
=
0x1
;
//能量回收设置
R485_ID41h
.
Sig
.
TotalBatteryVoltage
=
0xC8
;
//总电池电压
R485_ID41h
.
Sig
.
ICMCalculatesVehicleSpeed
=
0x12F
;
//速度 = (X * 0.512 * 3.14 * 1.05) / 30 44km
R485_ID41h
.
Sig
.
TotalBatterySOC
=
0x58
;
//电量
R485_ID41h
.
Sig
.
VehicleStatus
=
0x3
;
//整车状态
R485_ID41h
.
Sig
.
SpeedGear
=
0x
0
;
//挡位
R485_ID41h
.
Sig
.
SpeedGear
=
0x
1
;
//挡位
//功率暂空一会做
R485_ID41h
.
Sig
.
IOTRealTime_Hour
=
0xE
;
//时间:时
R485_ID41h
.
Sig
.
IOTRealTime_Minute
=
0x2C
;
//时间:分
...
...
@@ -345,13 +351,15 @@ void R485_Send_0x41(void)
R485_ID41h
.
Sig
.
CruiseMode
=
0x0
;
//巡航
R485_ID41h
.
Sig
.
RecuperationStatusFeedback
=
0x1
;
//能量回收设置
R485_ID41h
.
Sig
.
TotalBatteryVoltage
=
0xC8
;
//总电池电压
R485_ID41h
.
Sig
.
ICMCalculatesVehicleSpeed
=
0x17A
;
//速度 = (X * 0.512 * 3.14 * 1.05) / 30 55km
R485_ID41h
.
Sig
.
TotalBatterySOC
=
0x6E
;
//电量
R485_ID41h
.
Sig
.
VehicleStatus
=
0x3
;
//整车状态
R485_ID41h
.
Sig
.
SpeedGear
=
0x
3
;
//挡位
R485_ID41h
.
Sig
.
SpeedGear
=
0x
1
;
//挡位
//功率暂空一会做
R485_ID41h
.
Sig
.
IOTRealTime_Hour
=
0xF
;
//时间:时
R485_ID41h
.
Sig
.
IOTRealTime_Minute
=
0x37
;
//时间:分
R485_ID41h
.
Sig
.
IOTRealTime_Second
=
0
;
//时间:秒
...
...
@@ -392,12 +400,14 @@ void R485_Send_0x41(void)
R485_ID41h
.
Sig
.
SupportSwitchSignalFeedback
=
0x0
;
//边撑
R485_ID41h
.
Sig
.
CruiseMode
=
0x0
;
//巡航
R485_ID41h
.
Sig
.
RecuperationStatusFeedback
=
0x1
;
//能量回收设置
R485_ID41h
.
Sig
.
TotalBatteryVoltage
=
0xC8
;
//总电池电压
R485_ID41h
.
Sig
.
ICMCalculatesVehicleSpeed
=
0x1C4
;
//速度 = (X * 0.512 * 3.14 * 1.05) / 30 66km
R485_ID41h
.
Sig
.
TotalBatterySOC
=
0x84
;
//电量
R485_ID41h
.
Sig
.
VehicleStatus
=
0x3
;
//整车状态
R485_ID41h
.
Sig
.
SpeedGear
=
0x
3
;
//挡位
R485_ID41h
.
Sig
.
SpeedGear
=
0x
1
;
//挡位
//功率暂空一会做
R485_ID41h
.
Sig
.
IOTRealTime_Hour
=
0x10
;
//时间:时
R485_ID41h
.
Sig
.
IOTRealTime_Minute
=
0x6
;
//时间:分
...
...
@@ -485,7 +495,7 @@ void R485_Send_0x41(void)
R485_ID41h
.
Sig
.
ICMCalculatesVehicleSpeed
=
0x25F
;
//速度 = (X * 0.512 * 3.14 * 1.05) / 30 88km
R485_ID41h
.
Sig
.
TotalBatterySOC
=
0xB0
;
//电量
R485_ID41h
.
Sig
.
VehicleStatus
=
0x3
;
//整车状态
R485_ID41h
.
Sig
.
SpeedGear
=
0
;
//挡位
R485_ID41h
.
Sig
.
SpeedGear
=
0
x1
;
//挡位
//功率暂空一会做
R485_ID41h
.
Sig
.
IOTRealTime_Hour
=
0x12
;
//时间:时
R485_ID41h
.
Sig
.
IOTRealTime_Minute
=
0x8
;
//时间:分
...
...
@@ -520,8 +530,8 @@ void R485_Send_0x41(void)
R485_ID41h
.
Sig
.
VehicleStatus
=
0x3
;
//整车状态
R485_ID41h
.
Sig
.
SpeedGear
=
0
;
//挡位
//功率暂空一会做
R485_ID41h
.
Sig
.
IOTRealTime_Hour
=
0x1
2
;
//时间:时
R485_ID41h
.
Sig
.
IOTRealTime_Minute
=
0x
8
;
//时间:分
R485_ID41h
.
Sig
.
IOTRealTime_Hour
=
0x1
3
;
//时间:时
R485_ID41h
.
Sig
.
IOTRealTime_Minute
=
0x
9
;
//时间:分
R485_ID41h
.
Sig
.
IOTRealTime_Second
=
0
;
//时间:秒
R485_ID41h
.
Sig
.
EleHeadlightFunctionSettings
=
0x1
;
// 自动大灯
...
...
@@ -614,15 +624,18 @@ void R485_Send_0x42(void)
R485_ID42h
.
Sig
.
TotalBatteryCurrent
=
0xFA
;
//母线电流
break
;
case
4
:
// R485_ID42h.Sig.TotalBatteryCurrent = 0x46;
R485_ID42h
.
Sig
.
SuperTPower
=
0x0
;
//超级T动力模式
R485_ID42h
.
Sig
.
TPower
=
0x1
;
//T动力状态
break
;
case
5
:
R485_ID42h
.
Sig
.
TotalBatteryCurrent
=
0x31
;
break
;
case
6
:
R485_ID42h
.
Sig
.
TotalBatteryCurrent
=
0x2F
;
break
;
case
7
:
R485_ID42h
.
Sig
.
TotalBatteryCurrent
=
0x1
;
break
;
case
8
:
break
;
...
...
source/api_RS485.c
View file @
83359f75
...
...
@@ -356,7 +356,8 @@ void RS485_User_Tx_Data(void)
}
if
(
flag
==
1
)
{
Port_SetPortPinLevel
(
1
,
4
,
PortGpioLow
);
// 设置引脚s
// Port_SetPortPinLevel(1, 4, PortGpioLow); // 设置引脚s
//暂时不做接收
}
//
...
...
source/app/api_adc/api_adc.c
View file @
83359f75
...
...
@@ -19,15 +19,15 @@ void ADCInit(void)
{
InitADC
();
//
stc_port_pin_config_t stc_port_pin_configadc = {
//
.enOutputFunction = PortOutputResourceGPIO,
//
.enPullResistor = PortPullResistorNone,
//
.bInputEnable = TRUE,
//
.enGpioDirection = PortGpioInput};
stc_port_pin_config_t
stc_port_pin_configadc
=
{
.
enOutputFunction
=
PortOutputResourceGPIO
,
.
enPullResistor
=
PortPullResistorNone
,
.
bInputEnable
=
TRUE
,
.
enGpioDirection
=
PortGpioInput
};
// //Quiescent Current ��̬����
// Port_SetPinConfig(1, 3, &stc_port_pin_configadc );
//
InitADCch(Quiescent_Current);
InitADCch
(
Quiescent_Current
);
// //5V��
// Port_SetPinConfig(1, 7, &stc_port_pin_configadc );
...
...
@@ -67,7 +67,7 @@ void GetADCVolue(void)
Adc12b_TriggerConversion(&ADC12B0, DMS_UP_AD_CH);
Adc12b_TriggerConversion(&ADC12B0, DMS_DOWN_AD_CH);
*/
//
Adc12b_TriggerConversion(&ADC12B0, Quiescent_Current); //��̬����
Adc12b_TriggerConversion
(
&
ADC12B0
,
Quiescent_Current
);
//��̬����
// Adc12b_TriggerConversion(&ADC12B0, KL5V_AD_CH); //5V
// Adc12b_TriggerConversion(&ADC12B0, KEY5_AD_CH);
}
...
...
source/app/api_gpio/io_config.c
View file @
83359f75
...
...
@@ -113,6 +113,7 @@ void Api_GPIO_Init(void)
Port_SetPinConfig
(
1
,
15
,
&
stc_OUT_pin_config
);
// b+~
//BD8379����
// Port_SetPinConfig(2, 1, &stc_OUT_pin_config); //L_ONEBitCLU_OUT
Port_SetPinConfig
(
2
,
4
,
&
stc_OUT_pin_config
);
//L_ONEBitCLU_OUT
Port_SetPinConfig
(
2
,
5
,
&
stc_OUT_pin_config
);
//L_CLKBitCLU_OUT
Port_SetPinConfig
(
2
,
6
,
&
stc_OUT_pin_config
);
//L_SerinBitCLU_OUT
...
...
@@ -207,7 +208,15 @@ void Line_Temp(void)
{
switch
(
HJ_OtherKeyCurrent
.
count
)
{
case
0
:
case
0
:
LINE_LampLowOFF
;
LINE_LampHighOFF
;
LINE_weizhiOFF
;
LINE_TurnLeftOFF
;
LINE_TurnRightOFF
;
LINE_ABSON
;
LINE_BLEOFF
;
case
1
:
LINE_LampLowON
;
LINE_LampHighOFF
;
LINE_weizhiOFF
;
...
...
@@ -216,7 +225,7 @@ void Line_Temp(void)
LINE_ABSOFF
;
LINE_BLEOFF
;
break
;
case
1
:
case
2
:
LINE_LampLowOFF
;
LINE_LampHighON
;
LINE_weizhiOFF
;
...
...
@@ -225,8 +234,8 @@ void Line_Temp(void)
LINE_ABSOFF
;
LINE_BLEOFF
;
break
;
case
2
:
LINE_LampLowO
N
;
case
3
:
LINE_LampLowO
FF
;
LINE_LampHighOFF
;
LINE_weizhiON
;
LINE_TurnLeftOFF
;
...
...
@@ -234,8 +243,8 @@ void Line_Temp(void)
LINE_ABSOFF
;
LINE_BLEOFF
;
break
;
case
3
:
LINE_LampLowO
N
;
case
4
:
LINE_LampLowO
FF
;
LINE_LampHighOFF
;
LINE_weizhiOFF
;
LINE_TurnLeftOFF
;
...
...
@@ -243,8 +252,8 @@ void Line_Temp(void)
LINE_ABSOFF
;
LINE_BLEOFF
;
break
;
case
4
:
LINE_LampLowO
N
;
case
5
:
LINE_LampLowO
FF
;
LINE_LampHighOFF
;
LINE_weizhiOFF
;
LINE_TurnLeftOFF
;
...
...
@@ -252,8 +261,8 @@ void Line_Temp(void)
LINE_ABSOFF
;
LINE_BLEOFF
;
break
;
case
5
:
LINE_LampLowO
N
;
case
6
:
LINE_LampLowO
FF
;
LINE_LampHighOFF
;
LINE_weizhiOFF
;
LINE_TurnLeftOFF
;
...
...
@@ -261,8 +270,8 @@ void Line_Temp(void)
LINE_ABSOFF
;
LINE_BLEOFF
;
break
;
case
6
:
LINE_LampLowO
N
;
case
7
:
LINE_LampLowO
FF
;
LINE_LampHighOFF
;
LINE_weizhiOFF
;
LINE_TurnLeftOFF
;
...
...
@@ -270,8 +279,8 @@ void Line_Temp(void)
LINE_ABSON
;
LINE_BLEOFF
;
break
;
case
7
:
LINE_LampLowO
N
;
case
8
:
LINE_LampLowO
FF
;
LINE_LampHighOFF
;
LINE_weizhiOFF
;
LINE_TurnLeftOFF
;
...
...
@@ -279,8 +288,8 @@ void Line_Temp(void)
LINE_ABSOFF
;
LINE_BLEON
;
break
;
case
8
:
LINE_LampLowO
N
;
case
9
:
LINE_LampLowO
FF
;
LINE_LampHighOFF
;
LINE_weizhiOFF
;
LINE_TurnLeftOFF
;
...
...
@@ -288,7 +297,7 @@ void Line_Temp(void)
LINE_ABSOFF
;
LINE_BLEOFF
;
break
;
case
9
:
case
10
:
LINE_LampLowON
;
LINE_LampHighON
;
LINE_weizhiON
;
...
...
@@ -298,7 +307,7 @@ void Line_Temp(void)
LINE_BLEON
;
break
;
default:
LINE_LampLowO
N
;
LINE_LampLowO
FF
;
LINE_LampHighOFF
;
LINE_weizhiOFF
;
LINE_TurnLeftOFF
;
...
...
source/app/api_gpio/io_config.h
View file @
83359f75
...
...
@@ -32,13 +32,13 @@ extern en_port_gpio_level_t BUTTON_Back_light_IN;
#define GET_BUTTON_Back_light_LEVEL Port_GetPortPinLevel(2, 11, &BUTTON_Back_light_IN)
extern
en_port_gpio_level_t
BUTTON_AUTO_IN
;
//
#define GET_BUTTON_AUTO_LEVEL Port_GetPortPinLevel(1, 27, &BUTTON_AUTO_IN)
#define GET_BUTTON_AUTO_LEVEL Port_GetPortPinLevel(1, 27, &BUTTON_AUTO_IN)
extern
en_port_gpio_level_t
BUTTON_EOL_IN
;
#define GET_BUTTON_EOL_LEVEL Port_GetPortPinLevel(0, 5, &BUTTON_EOL_IN)
extern
en_port_gpio_level_t
BUTTON_SPEED_UP_IN
;
//
#define GET_BUTTON_SPEED_UP_LEVEL Port_GetPortPinLevel(1, 29, &BUTTON_SPEED_UP_IN)
#define GET_BUTTON_SPEED_UP_LEVEL Port_GetPortPinLevel(1, 29, &BUTTON_SPEED_UP_IN)
extern
en_port_gpio_level_t
BUTTON_SPEED_DOWN_IN
;
#define GET_BUTTON_SPEED_DOWN_LEVEL Port_GetPortPinLevel(1, 30, &BUTTON_SPEED_DOWN_IN)
...
...
@@ -124,7 +124,7 @@ extern en_port_gpio_level_t BUTTON_GND_Signal3_IN;
#define FUEL_IN_EN(Level) Port_SetPortPinLevel( 2, 12, (Level));
#define R_OUT(Level) Port_SetPortPinLevel(2, 14, (Level))
#define N_OUT(Level) Port_SetPortPinLevel(2, 27, (Level))
//
#define N_OUT(Level) Port_SetPortPinLevel(2, 27, (Level))
#if (CAN_2ND)
#define CAN0_STB(Level) Port_SetPortPinLevel(0, 29, (Level))
#define CAN1_STB(Level) Port_SetPortPinLevel(1, 22, PortGpioHigh)
...
...
@@ -138,8 +138,8 @@ extern en_port_gpio_level_t BUTTON_GND_Signal3_IN;
extern
en_port_gpio_level_t
Can1Rx_IN
;
#define GET_CAN1_RX_IN_LEVEL Port_GetPortPinLevel(0, 27, &Can1Rx_IN)
#define LINE_LampLowON Port_SetPortPinLevel(2,
5
,PortGpioHigh)
#define LINE_LampLowOFF Port_SetPortPinLevel(2,
5
,PortGpioLow)
#define LINE_LampLowON Port_SetPortPinLevel(2,
1
,PortGpioHigh)
#define LINE_LampLowOFF Port_SetPortPinLevel(2,
1
,PortGpioLow)
#define LINE_LampHighON Port_SetPortPinLevel(2,0,PortGpioHigh)
#define LINE_LampHighOFF Port_SetPortPinLevel(2,0,PortGpioLow)
...
...
@@ -147,17 +147,17 @@ extern en_port_gpio_level_t Can1Rx_IN;
#define LINE_weizhiON Port_SetPortPinLevel(1,25,PortGpioHigh)
#define LINE_weizhiOFF Port_SetPortPinLevel(1,25,PortGpioLow)
#define LINE_TurnLeftON Port_SetPortPinLevel(2,27,PortGpio
Low
)
#define LINE_TurnLeftOFF Port_SetPortPinLevel(2,27,PortGpio
High
)
#define LINE_TurnLeftON Port_SetPortPinLevel(2,27,PortGpio
High
)
#define LINE_TurnLeftOFF Port_SetPortPinLevel(2,27,PortGpio
Low
)
#define LINE_TurnRightON Port_SetPortPinLevel(2,29,PortGpio
Low
)
#define LINE_TurnRightOFF Port_SetPortPinLevel(2,29,PortGpio
High
)
#define LINE_TurnRightON Port_SetPortPinLevel(2,29,PortGpio
High
)
#define LINE_TurnRightOFF Port_SetPortPinLevel(2,29,PortGpio
Low
)
#define LINE_ABSON Port_SetPortPinLevel(1,24,PortGpioHigh)
#define LINE_ABSOFF Port_SetPortPinLevel(1,24,PortGpioLow)
#define LINE_BLEON Port_SetPortPinLevel(
1,24
,PortGpioHigh)
#define LINE_BLEOFF Port_SetPortPinLevel(
1,24
,PortGpioLow)
#define LINE_BLEON Port_SetPortPinLevel(
0,30
,PortGpioHigh)
#define LINE_BLEOFF Port_SetPortPinLevel(
0,30
,PortGpioLow)
extern
void
Api_GPIO_Init
(
void
);
extern
void
Line_Temp
(
void
);
...
...
source/bsp_source/bsp_adc/adc12b_driver.c
View file @
83359f75
...
...
@@ -247,7 +247,7 @@ void InitADCch(uint8_t ch)
Adc12b_SetComparisonTime
(
&
ADC12B0
,
4
);
Adc12b_SetResumptionTime
(
&
ADC12B0
,
63
);
Adc12b_SetSamplingTime
(
&
ADC12B0
,
0
,
20
);
//
Adc12b_TriggerConversion(&ADC12B0, ch);
Adc12b_TriggerConversion
(
&
ADC12B0
,
ch
);
}
void
InitADC
(
void
)
...
...
source/bsp_source/bsp_button/bsp_app_AUTO.c
View file @
83359f75
...
...
@@ -1900,7 +1900,7 @@ void StaticCurrentCheck(void)//???????
//MC1413_IGNON;
//MC1413_BON;
//MC1413_B_OFF;
CANSendEnable
=
ON
;
//
CANSendEnable = ON;
if
(
BetweenTime
(
STATIC_BEGIN_CHECK_TIME
,
STATIC_BEGIN_CHECK_TIME
+
CLUSTER_START_TIME
))
{
//uint8_t test1=1;
SetStartTime
(
0
);
...
...
@@ -1943,6 +1943,7 @@ void StaticCurrentCheck(void)//???????
}
}
StaticCurrentNum
=
StaticCurrent
.
Value
;
}
...
...
source/bsp_source/bsp_button/bsp_app_led_output.c
View file @
83359f75
This diff is collapsed.
Click to expand it.
source/bsp_source/bsp_button/bsp_button.c
View file @
83359f75
...
...
@@ -167,15 +167,15 @@ void Get_Button_Value()//��ȡ����AD
}
#endif
#if (FUNCTION_KEY_AUTO)
//
GET_BUTTON_AUTO_LEVEL;
//
if(BUTTON_AUTO_IN == 0){
//
if (CheckOkTimerCnts == 0) {
//
Botton.Auto.Flag = 1;
//
}
//
} else {
//
CheckOkTimerCnts = 0;
//
Botton.Auto.Flag = 0;
//
}
GET_BUTTON_AUTO_LEVEL
;
if
(
BUTTON_AUTO_IN
==
0
){
if
(
CheckOkTimerCnts
==
0
)
{
Botton
.
Auto
.
Flag
=
1
;
}
}
else
{
CheckOkTimerCnts
=
0
;
Botton
.
Auto
.
Flag
=
0
;
}
#endif
#if (FUNCTION_KEY_EOL)
GET_BUTTON_EOL_LEVEL
;
...
...
@@ -186,18 +186,18 @@ void Get_Button_Value()//��ȡ����AD
Botton
.
EOL
.
Flag
=
0
;
#endif
#if (FUNCTION_KEY_SPEED_UP)
//
GET_BUTTON_SPEED_UP_LEVEL;
//
if(BUTTON_SPEED_UP_IN == 0)
//
Botton.SpeedUp.Flag = 1;
//
else
//
Botton.SpeedUp.Flag = 0;
GET_BUTTON_SPEED_UP_LEVEL
;
if
(
BUTTON_SPEED_UP_IN
==
0
)
Botton
.
SpeedUp
.
Flag
=
1
;
else
Botton
.
SpeedUp
.
Flag
=
0
;
#endif
#if (FUNCTION_KEY_SPEED_DOWN)
//
GET_BUTTON_SPEED_DOWN_LEVEL;
//
if(BUTTON_SPEED_DOWN_IN == 0)
//
Botton.SpeedDown.Flag = 1;
//
else
//
Botton.SpeedDown.Flag = 0;
GET_BUTTON_SPEED_DOWN_LEVEL
;
if
(
BUTTON_SPEED_DOWN_IN
==
0
)
Botton
.
SpeedDown
.
Flag
=
1
;
else
Botton
.
SpeedDown
.
Flag
=
0
;
#endif
#if (FUNCTION_KEY_LED)
GET_BUTTON_LED_LEVEL
;
...
...
@@ -541,15 +541,15 @@ void Button_Statu_Manage(void)
if
(
LED_High_Beam_Status
==
1
)
{
Port_SetPortPinLevel
(
2
,
1
,
PortGpioHigh
);
//远光
//
Port_SetPortPinLevel(2, 1, PortGpioHigh);//远光
}
else
{
Port_SetPortPinLevel
(
2
,
1
,
PortGpioLow
);
//远光
//
Port_SetPortPinLevel(2, 1, PortGpioLow);//远光
}
if
(
LED_High_Beam_Flag
==
0
)
{
Port_SetPortPinLevel
(
2
,
1
,
PortGpioLow
);
//远光
//
Port_SetPortPinLevel(2, 1, PortGpioLow);//远光
}
}
if
(
Botton
.
EOL
.
Flag
==
1
){
//EOL
...
...
@@ -2321,8 +2321,8 @@ void HJ_SwitchSecondPage()
}
FortOthercount
=
Othercount
;
if
(
OthercountTime
>
0
)
{
Port_SetPortPinLevel
(
2
,
27
,
PortGpioLow
);
Port_SetPortPinLevel
(
2
,
12
,
PortGpioLow
);
//
Port_SetPortPinLevel(2, 27, PortGpioLow);
//
Port_SetPortPinLevel(2, 12, PortGpioLow);
}
else
if
(
OthercountTime
==
0
)
{
if
(
HJ_OtherKeyCurrent
.
count
>
11
)
{
...
...
@@ -2477,6 +2477,7 @@ uint8_t Gear_SWCount = 1;
uint8_t
SWCountConfig
=
0
;
void
Stage_Manage
()
{
Line_Temp
();
if
(
SWCountConfig
==
0
)
{
SWCountConfig
=
1
;
...
...
@@ -2687,7 +2688,7 @@ void Stage_Manage()
// DOWNKeyCurrent.count ++;
g_Stage
=
STAGE_Other
;
Line_Temp
();
RS485_User_Tx_Data
();
ClearOtherSWFlagFun
();
ClearOtherFlagFun
();
...
...
@@ -2724,7 +2725,7 @@ void Stage_Manage()
Port_SetPortPinLevel
(
2
,
3
,
PortGpioLow
);
//��ȫ��
Port_SetPortPinLevel
(
2
,
20
,
PortGpioLow
);
//����ѹ��
//Port_SetPortPinLevel(0, 0, PortGpioLow);//���ر���
Port_SetPortPinLevel
(
2
,
1
,
PortGpioLow
);
//WaterSeparator
//
Port_SetPortPinLevel(2, 1, PortGpioLow);//WaterSeparator
#if (CAN_2ND)
CGW_PC5
.
msg
.
bits
.
CF_Ems_IsgStat
=
0x4
;
//ISG ��
CGW_PC5
.
msg
.
bits
.
CF_Ems_IsgStat2
=
0x1
;
//ISG ��
...
...
source/bsp_source/bsp_motor/bsp_motor.c
View file @
83359f75
...
...
@@ -4,11 +4,11 @@
void
Set_SMC_ClkDiv
(
stc_smcn_t
*
psmc_cofig
,
uint8_t
div
);
/*************************************************
Function: // Set_SMC_ClkDiv
Description: //
设置时钟分
频
Description: //
����ʱ�ӷ�Ƶ
Input: //
Output: //
无
Return: //
无
Others: //
其它说明
Output: //
��
Return: //
��
Others: //
����˵��
*************************************************/
void
Set_SMC_ClkDiv
(
stc_smcn_t
*
psmc_cofig
,
uint8_t
div
)
{
...
...
@@ -62,13 +62,13 @@ void Set_SMC_ClkDiv(stc_smcn_t* psmc_cofig,uint8_t div)
}
/*************************************************
Function: // SMC_Drive_Init
Description: //
初始化 电机 模块
Description: //
��ʼ�� ��� ģ��
Input: // motorConfig
// motorConfig.motor_sel bit0: [SMC0] --- bit5[SMC5] 1: Enalbe
// cycle_with:
周期位数 0是8位,1是
10位
Output: //
无
Return: //
无
Others: //
其它说明
// cycle_with:
����λ�� 0��8λ��1��10λ
Output: //
��
Return: //
��
Others: //
����˵��
*************************************************/
void
SMC_Drive_Init
(
stc_motor_t
*
motorConfig
,
uint8_t
cycle_width
,
uint8_t
clkdiv
)
{
...
...
@@ -400,7 +400,7 @@ void SMC_Drive_Init(stc_motor_t *motorConfig,uint8_t cycle_width,uint8_t clkdiv)
.
enGpioInitOutputLevel
=
PortGpioLow
};
#if (CAN_2ND)
Port_SetPinConfig
(
2
,
1
,
&
stc_port_pin_config2_01
);
//
Port_SetPinConfig( 2, 1, &stc_port_pin_config2_01 );
#endif
//
m_stc_smc
.
unPWC
.
u16Register
=
0
;
...
...
@@ -429,12 +429,12 @@ void SMC_Drive_Init(stc_motor_t *motorConfig,uint8_t cycle_width,uint8_t clkdiv)
}
/*************************************************
Function: // Motor_Move
Description: //
电机走动驱动
Input: // timeLimit:占
空比每次变化间隔时间
Description: //
����߶�����
Input: // timeLimit:ռ
�ձ�ÿ�α仯���ʱ��
// motorIndex [0 - 5]
Output: //
无
Return: //
无
Others: //
其它说明
Output: //
��
Return: //
��
Others: //
����˵��
*************************************************/
void
Motor_Move
(
_MeterPos
*
meter
)
{
...
...
source/main.c
View file @
83359f75
...
...
@@ -789,7 +789,7 @@ void CANInit(void)
TIMER_100us_Init
();
TIMER1_1ms_Init
();
TIMER_10ms_Init
();
//
ADCInit();
ADCInit
();
ICU_IO_Initialize
();
// CANInit();
Init_Pwm
();
...
...
@@ -805,6 +805,10 @@ void CANInit(void)
IRQ_ENABLE
();
ReadDataFormWorkFlash
();
BenchTpInit
(
0x002
);
Port_SetPortPinLevel
(
1
,
21
,
PortGpioHigh
);
Port_SetPortPinLevel
(
1
,
20
,
PortGpioHigh
);
Port_SetPortPinLevel
(
1
,
19
,
PortGpioLow
);
Port_SetPortPinLevel
(
1
,
15
,
PortGpioHigh
);
// CANSendEnable = ON;
// MC1413_IGNON;
...
...
@@ -835,7 +839,7 @@ void CANInit(void)
#if ((PRO_CONFIG_CHECK_APPLY) || (PRO_CONFIG_EOL_APPLY))
for
(;;)
{
GetADCVolue
();
RS485_User_Tx_Data
();
// // Port_SetPortPinLevel(1, 21, PortGpioLow);//测试
...
...
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