Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
DC360_1drap3_xiaoju_V1
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
丁雨邯
DC360_1drap3_xiaoju_V1
Commits
5a5d23e5
提交
5a5d23e5
authored
5月 05, 2020
作者:
wysheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复一些错误
1. 错误的发送停止充电完成 2. BMS需求电压 电流
上级
6152cb7a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
224 行增加
和
184 行删除
+224
-184
Drv_TCUComm.c
DcPillar/Src/Drivers/Drv_TCUComm.c
+0
-0
Drv_SmartAllocation.c
DcPillar/Src/SmartAllocation/Drv_SmartAllocation.c
+109
-95
SmartAllocation_B_ChgRun.c
DcPillar/Src/SmartAllocation/SmartAllocation_B_ChgRun.c
+34
-10
SmartAllocation_ChgRun.c
DcPillar/Src/SmartAllocation/SmartAllocation_ChgRun.c
+0
-0
Thd_TCU.c
DcPillar/Src/Thread/Thd_TCU.c
+81
-79
没有找到文件。
DcPillar/Src/Drivers/Drv_TCUComm.c
浏览文件 @
5a5d23e5
差异被折叠。
点击展开。
DcPillar/Src/SmartAllocation/Drv_SmartAllocation.c
浏览文件 @
5a5d23e5
...
...
@@ -141,13 +141,13 @@ void DcModuleManageProcess_SmartAllocation(void)
Flag
=
Flag
<<
1
;
}
DcModuleManage_All
.
ValidNum
=
Count
;
//DcModuleManage_All.ValidNum = Count;
for
(
i
=
0
;
i
<
DcModuleGroupSize
;
i
++
)
{
Currt
=
0
;
Volt
=
0
;
Count
=
0
;
status
=
DcModuleGroup
[
i
].
modules
[
0
].
status
;
for
(
j
=
0
;
j
<
DcModuleGroup
[
i
].
num
;
j
++
)
{
...
...
@@ -169,43 +169,22 @@ void DcModuleManageProcess_SmartAllocation(void)
DcModuleGroup
[
i
].
modules
[
j
].
status
=
Invalid
;
}
status
=
status
|
DcModuleGroup
[
i
].
modules
[
j
].
status
;
}
DcModuleGroup
[
i
].
ValidNum
=
Count
;
DcModuleGroup
[
i
].
Voltage
=
Volt
/
Count
;
DcModuleGroup
[
i
].
Current
=
Currt
;
}
for
(
i
=
0
;
i
<
DcModuleGroupSize
;
i
++
)
{
status
=
DcModuleGroup
[
i
].
modules
[
0
].
status
;
if
(
DcModuleGroup
[
i
].
num
!=
DcModuleGroup
[
i
].
ValidNum
)
{
}
if
(
DcModuleGroup
[
i
].
num
>
1
)
{
if
(
status
!=
Valid
)
{
if
(
DcModuleGroup
[
i
].
modules
[
1
].
status
!=
Valid
)
{
DcModuleGroup
[
i
].
status
=
Invalid
;
if
(
status
==
Invalid
)
DcModuleGroup
[
i
].
status
=
status
;
else
if
(
DcModuleGroup
[
i
].
status
==
Invalid
)
DcModuleGroup
[
i
].
status
=
status
;
}
}
}
else
{
if
(
status
!=
Valid
)
{
DcModuleGroup
[
i
].
status
=
Invalid
;
}
}
}
Currt
=
0
;
Currt_A
=
0
;
Currt_B
=
0
;
...
...
@@ -216,6 +195,10 @@ void DcModuleManageProcess_SmartAllocation(void)
Count_A
=
0
;
Count_B
=
0
;
u8
groupCount
=
0
;
u8
groupCount_A
=
0
;
u8
groupCount_B
=
0
;
for
(
i
=
0
;
i
<
DcModuleGroupSize
;
i
++
)
{
if
(
DcModuleGroup
[
i
].
status
==
Valid
)
...
...
@@ -223,27 +206,48 @@ void DcModuleManageProcess_SmartAllocation(void)
Volt
+=
DcModuleGroup
[
i
].
Voltage
;
Currt
+=
DcModuleGroup
[
i
].
Current
;
Count
+=
DcModuleGroup
[
i
].
ValidNum
;
groupCount
++
;
}
else
if
(
DcModuleGroup
[
i
].
status
==
Hold_A
)
{
Volt_A
+=
DcModuleGroup
[
i
].
Voltage
;
Currt_A
+=
DcModuleGroup
[
i
].
Current
;
Count_A
+=
DcModuleGroup
[
i
].
ValidNum
;
groupCount_A
++
;
}
else
if
(
DcModuleGroup
[
i
].
status
==
Hold_B
)
{
Volt_B
+=
DcModuleGroup
[
i
].
Voltage
;
Currt_B
+=
DcModuleGroup
[
i
].
Current
;
Count_B
+=
DcModuleGroup
[
i
].
ValidNum
;
groupCount_B
++
;
}
}
DcModuleCtrl
.
ActualCurrt
=
Currt_A
;
DcModuleCtrl
.
ActualVolt
=
Volt_A
;
DcModuleCtrl_ALL
.
ActualCurrt
=
Currt_A
;
DcModuleCtrl_ALL
.
ActualVolt
=
Volt_A
;
if
(
groupCount_A
)
DcModuleCtrl
.
ActualVolt
=
Volt_A
/
groupCount_A
;
else
DcModuleCtrl
.
ActualVolt
=
0
;
DcModuleCtrl_ALL
.
ActualCurrt
=
Currt
;
if
(
groupCount
)
DcModuleCtrl_ALL
.
ActualVolt
=
Volt
/
groupCount
;
else
DcModuleCtrl_ALL
.
ActualVolt
=
0
;
DcModuleCtrl_B
.
ActualCurrt
=
Currt_B
;
DcModuleCtrl_B
.
ActualVolt
=
Volt_B
;
if
(
groupCount_B
)
DcModuleCtrl_B
.
ActualVolt
=
Volt_B
/
(
groupCount_B
);
else
DcModuleCtrl_B
.
ActualVolt
=
0
;
DcModuleManage
.
ValidNum
=
Count_A
;
DcModuleManage_All
.
ValidNum
=
Count
;
...
...
@@ -273,93 +277,98 @@ void DcModuleCtrlProcess_SmartAllocation(void)
StructDcModuleSend
DataSend
;
u32
Temp
;
u8
addr
;
u32
Volt
=
0
;
u8
Cmd
=
0
;
u32
Volt
=
0
;
u8
Cmd
=
0
;
Temp
=
0
;
for
(
u8
i
=
0
;
i
<
DcModuleGroupSize
;
i
++
)
{
if
(
status
[
i
]
!=
DcModuleGroup
[
i
].
status
)
{
Temp
=
1
;
Volt
=
DcModuleAbility
.
MinVolt
*
100
;
Temp
=
1
;
Volt
=
DcModuleAbility
.
MinVolt
*
100
;
if
(
DcModuleGroup
[
i
].
status
==
Valid
)
{
//关机
if
(
status
[
i
]
==
Hold_A
)
{
if
(
i
==
0
)
if
(
i
==
0
)
{
DcModuleManage
.
SetVolt
=
DcModuleAbility
.
MinVolt
*
100
;
DcModuleManage
.
SetCurrt
=
DcModuleAbility
.
MinCurrt
*
100
;
DcModuleManage
.
Cmd
=
0xAA
;
//关机
DcModuleManage
.
Cmd
=
0xAA
;
//关机
}
else
if
(
i
==
1
)
else
if
(
i
==
1
)
{
GPIO_ResetBits
(
RELAY_K1K2_Port
,
RELAY_K1K2_Pin
);
GPIO_ResetBits
(
RELAY_K1K2_Port
,
RELAY_K1K2_Pin
);
}
else
if
(
i
==
2
)
else
if
(
i
==
2
)
{
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
else
// if(i == 3)
else
// if(i == 3)
{
GPIO_ResetBits
(
RELAY_K3K4_Port
,
RELAY_K3K4_Pin
);
GPIO_ResetBits
(
RELAY_K3K4_Port
,
RELAY_K3K4_Pin
);
}
}
else
if
(
status
[
i
]
==
Hold_B
)
{
if
(
i
==
2
)
if
(
i
==
2
)
{
DcModuleManage_B
.
SetVolt
=
DcModuleAbility
.
MinVolt
*
100
;
DcModuleManage_B
.
SetCurrt
=
DcModuleAbility
.
MinCurrt
*
100
;
DcModuleManage_B
.
Cmd
=
0xAA
;
//关机
DcModuleManage_B
.
Cmd
=
0xAA
;
//关机
}
else
if
(
i
==
0
)
else
if
(
i
==
0
)
{
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
else
if
(
i
==
1
)
else
if
(
i
==
1
)
{
GPIO_ResetBits
(
RELAY_K7K8_Port
,
RELAY_K7K8_Pin
);
GPIO_ResetBits
(
RELAY_K7K8_Port
,
RELAY_K7K8_Pin
);
}
else
// if(i == 3)
else
// if(i == 3)
{
GPIO_ResetBits
(
RELAY_K9K10_Port
,
RELAY_K9K10_Pin
);
GPIO_ResetBits
(
RELAY_K9K10_Port
,
RELAY_K9K10_Pin
);
}
}
//Volt = DcModuleAbility.MinVolt * 100;
Cmd
=
0xAA
;
//关机
Cmd
=
0xAA
;
//关机
}
else
if
(
DcModuleGroup
[
i
].
status
==
Hold_A
)
{
if
(
i
!=
0
)
//升压
if
(
i
!=
0
)
//升压
{
Volt
=
DcModuleManage
.
SetVolt
;
Volt
=
DcModuleManage
.
SetVolt
;
}
else
if
(
status
[
i
]
==
Hold_B
)
else
if
(
status
[
i
]
==
Hold_B
)
{
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
Cmd
=
0x55
;
//开机
Cmd
=
0x55
;
//开机
}
else
if
(
DcModuleGroup
[
i
].
status
==
Hold_B
)
{
if
(
i
!=
2
)
//升压
if
(
i
!=
2
)
//升压
{
Volt
=
DcModuleManage
.
SetVolt
;
Volt
=
DcModuleManage
.
SetVolt
;
}
else
if
(
status
[
i
]
==
Hold_A
)
else
if
(
status
[
i
]
==
Hold_A
)
{
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
Cmd
=
0x55
;
//开机
Cmd
=
0x55
;
//开机
}
else
{
}
for
(
u8
j
=
0
;
j
<
DcModuleGroup
[
i
].
num
;
j
++
)
{
addr
=
DcModuleGroup
[
i
].
modules
[
j
].
addr
;
...
...
@@ -371,7 +380,7 @@ void DcModuleCtrlProcess_SmartAllocation(void)
Temp
=
DcModuleAbility
.
MinCurrt
*
100
;
DataSend
.
Data
[
2
]
=
(
u8
)
(
Temp
>>
8
);
DataSend
.
Data
[
3
]
=
(
u8
)
(
Temp
>>
0
);
Temp
=
Volt
;
//DcModuleAbility.MinVolt * 100;
Temp
=
Volt
;
//DcModuleAbility.MinVolt * 100;
DataSend
.
Data
[
4
]
=
(
u8
)
(
Temp
>>
24
);
DataSend
.
Data
[
5
]
=
(
u8
)
(
Temp
>>
16
);
DataSend
.
Data
[
6
]
=
(
u8
)
(
Temp
>>
8
);
...
...
@@ -382,7 +391,7 @@ void DcModuleCtrlProcess_SmartAllocation(void)
{
//osDelay(10);
}
DataSend
.
Id
=
0x1307C080
+
addr
;
DataSend
.
Len
=
8
;
DataSend
.
Data
[
0
]
=
0x02
;
...
...
@@ -392,7 +401,7 @@ void DcModuleCtrlProcess_SmartAllocation(void)
DataSend
.
Data
[
4
]
=
0x00
;
DataSend
.
Data
[
5
]
=
0x00
;
DataSend
.
Data
[
6
]
=
0x00
;
DataSend
.
Data
[
7
]
=
Cmd
;
//关机
DataSend
.
Data
[
7
]
=
Cmd
;
//关机
//放入队列
if
(
pdTRUE
!=
xQueueSend
(
DcModeMsg
,
&
DataSend
,
0
))
...
...
@@ -400,12 +409,14 @@ void DcModuleCtrlProcess_SmartAllocation(void)
//osDelay(10);
}
}
status
[
i
]
=
DcModuleGroup
[
i
].
status
;
}
}
if
(
Temp
)
return
;
if
(
Temp
)
return
;
Temp
=
0
;
...
...
@@ -413,7 +424,8 @@ void DcModuleCtrlProcess_SmartAllocation(void)
{
if
(
status1
[
i
]
!=
DcModuleGroup
[
i
].
status
)
{
Temp
=
1
;
Temp
=
1
;
if
(
DcModuleGroup
[
i
].
status
==
Valid
)
{
//切换继电器
...
...
@@ -423,63 +435,65 @@ void DcModuleCtrlProcess_SmartAllocation(void)
}
else
if
(
status
[
i
]
==
Hold_B
)
{
}
}
else
if
(
DcModuleGroup
[
i
].
status
==
Hold_A
)
{
//切换继电器
if
(
i
==
0
)
if
(
i
==
0
)
{
}
else
if
(
i
==
1
)
else
if
(
i
==
1
)
{
GPIO_SetBits
(
RELAY_K1K2_Port
,
RELAY_K1K2_Pin
);
GPIO_SetBits
(
RELAY_K1K2_Port
,
RELAY_K1K2_Pin
);
}
else
if
(
i
==
2
)
else
if
(
i
==
2
)
{
GPIO_SetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
GPIO_SetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
else
// if(i == 3)
else
// if(i == 3)
{
GPIO_SetBits
(
RELAY_K3K4_Port
,
RELAY_K3K4_Pin
);
GPIO_SetBits
(
RELAY_K3K4_Port
,
RELAY_K3K4_Pin
);
}
}
else
if
(
DcModuleGroup
[
i
].
status
==
Hold_B
)
{
//切换继电器
if
(
i
==
2
)
if
(
i
==
2
)
{
}
else
if
(
i
==
0
)
else
if
(
i
==
0
)
{
GPIO_SetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
GPIO_SetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
else
if
(
i
==
1
)
else
if
(
i
==
1
)
{
GPIO_SetBits
(
RELAY_K7K8_Port
,
RELAY_K7K8_Pin
);
GPIO_SetBits
(
RELAY_K7K8_Port
,
RELAY_K7K8_Pin
);
}
else
// if(i == 3)
else
// if(i == 3)
{
GPIO_SetBits
(
RELAY_K9K10_Port
,
RELAY_K9K10_Pin
);
GPIO_SetBits
(
RELAY_K9K10_Port
,
RELAY_K9K10_Pin
);
}
}
else
{
//切换继电器
}
status1
[
i
]
=
DcModuleGroup
[
i
].
status
;
}
}
if
(
Temp
)
return
;
if
(
Temp
)
return
;
if
(
LastFlag_A
!=
DcModuleCtrl
.
CtrlFlag
)
{
LastFlag_A
=
DcModuleCtrl
.
CtrlFlag
;
...
...
DcPillar/Src/SmartAllocation/SmartAllocation_B_ChgRun.c
浏览文件 @
5a5d23e5
...
...
@@ -115,15 +115,15 @@ void ChgProChgRun_B(StructChargeCtrl_B *pChargeCtrl)
MaxCurrt
=
abs
((
s32
)
BclMsg_B
.
NeedCurrt
-
4000
);
NeedCurrt
=
abs
((
s32
)
BclMsg_B
.
NeedCurrt
-
4000
);
static
s16
GetCurrt_bak
;
if
(
abs
((
s16
)
GetDcModuleCurrt_B
()
-
GetCurrt_bak
)
<
10
//ȶ
&&
(
abs
((
s16
)
NeedCurrt
-
(
s16
)
GetDcModuleCurrt_B
())
>
(
DcModuleAbility
.
MaxCurrt
*
10
))
&&
(
abs
((
s16
)
NeedCurrt
-
(
s16
)
GetDcModuleCurrt_B
())
>
(
DcModuleAbility
.
MaxCurrt
*
10
))
)
{
if
(
0
==
UniChgTick
)
UniChgTick
=
GetSystemTick
();
if
((
GetSystemTick
()
-
UniChgTick
)
>
(
5
*
1000
))
{
if
(
NeedCurrt
>
GetDcModuleCurrt_B
())
...
...
@@ -169,14 +169,14 @@ void ChgProChgRun_B(StructChargeCtrl_B *pChargeCtrl)
{
UniChgTick
=
0
;
GetCurrt_bak
=
GetDcModuleCurrt_B
();
}
if
(
NeedCurrt
>
MaxCurrt
)
NeedCurrt
=
MaxCurrt
;
if
(
NeedCurrt
>
(
DcModuleAbility
.
MaxCurrt
*
DcModuleManage_B
.
ValidNum
))
NeedCurrt
=
DcModuleAbility
.
MaxCurrt
*
DcModuleManage_B
.
ValidNum
;
if
(
NeedCurrt
>
(
DcModuleAbility
.
MaxCurrt
*
(
DcModuleManage_B
.
ValidNum
+
DcModuleManage_All
.
ValidNum
)
))
NeedCurrt
=
DcModuleAbility
.
MaxCurrt
*
(
DcModuleManage_B
.
ValidNum
+
DcModuleManage_All
.
ValidNum
)
;
MaxVolt
=
BcpMsg_B
.
ChgMaxVolt
;
NeedVolt
=
BclMsg_B
.
NeedVolt
;
...
...
@@ -188,7 +188,7 @@ void ChgProChgRun_B(StructChargeCtrl_B *pChargeCtrl)
CcsChgEnable
=
1
;
DcModuleSet_B
(
eSwSta_On
,
NeedVolt
,
NeedCurrt
);
ChargeTimerSet_B
(
eSwSta_On
);
}
}
if
((
eChgVer_2011
!=
UserParam
.
ChgVer
)
&&
(
eChgVer_2011
!=
ChgVer_B
))
{
...
...
@@ -240,7 +240,7 @@ void ChgProChgRun_B(StructChargeCtrl_B *pChargeCtrl)
}
}
if
(
0
!=
BsmMsg_B
.
Valid
)
{
...
...
@@ -342,6 +342,30 @@ void ChgProChgRun_B(StructChargeCtrl_B *pChargeCtrl)
}
else
CemMsg_B
.
Cem
.
Value
.
Bcl
=
0
;
if
(((
GetSystemTick
()
-
BcsMsg_B
.
RecvTick
)
>
1000
+
500
)
&&
(
eChgVer_2011
==
UserParam
.
ChgVer
))
{
StructChargeSend
FrameSend
;
FrameSend
.
Id
.
Mult
=
0
;
FrameSend
.
Id
.
Disp
.
Prio
=
7
;
FrameSend
.
Id
.
Disp
.
PF
=
TPCM
>>
8
;
FrameSend
.
Id
.
Disp
.
DA_PS
=
Card1939Addr
;
FrameSend
.
Id
.
Disp
.
SA
=
Charger1939Addr
;
FrameSend
.
Data
[
0
]
=
0x13
;
FrameSend
.
Data
[
1
]
=
0x09
;
FrameSend
.
Data
[
2
]
=
0x00
;
FrameSend
.
Data
[
3
]
=
0x02
;
FrameSend
.
Data
[
4
]
=
0xFe
;
FrameSend
.
Data
[
5
]
=
0x00
;
FrameSend
.
Data
[
6
]
=
0x11
;
FrameSend
.
Data
[
7
]
=
0x00
;
FrameSend
.
Len
=
8
;
BmsCommSendMsg_B
(
&
FrameSend
);
BcsMsg_B
.
RecvTick
=
GetSystemTick
();
}
else
CemMsg_B
.
Cem
.
Value
.
Bcs
=
0
;
//ֶ֡
if
((
GetSystemTick
()
-
BcsMsg_B
.
RecvTick
)
>
MsgTimeout_B_5S
)
{
...
...
@@ -372,7 +396,7 @@ void ChgProChgRun_B(StructChargeCtrl_B *pChargeCtrl)
pChargeCtrl
->
Param
=
0
;
}
if
(
0
==
ChargeEnable_B
)
if
(
0
==
TCUCurChgRecd_B
.
TCUChargeEnable
)
{
//ⲿƽ
CstMsg_B
.
StopReason
.
Value
.
Manual
=
1
;
CST_Send_B
(
&
CstMsg_B
);
...
...
DcPillar/Src/SmartAllocation/SmartAllocation_ChgRun.c
浏览文件 @
5a5d23e5
差异被折叠。
点击展开。
DcPillar/Src/Thread/Thd_TCU.c
浏览文件 @
5a5d23e5
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论