Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
DC360_1drap3_xiaoju_V1
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
丁雨邯
DC360_1drap3_xiaoju_V1
Commits
7618bb67
提交
7618bb67
authored
6月 09, 2020
作者:
wysheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
重新梳理继电器控制
上级
c360bacd
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
105 行增加
和
21 行删除
+105
-21
Drv_TCUComm.c
DcPillar/Src/Drivers/Drv_TCUComm.c
+2
-2
Global.h
DcPillar/Src/Global.h
+1
-1
ChgPro_B_ChgRun_SmartAllocation.c
...lar/Src/SmartAllocation/ChgPro_B_ChgRun_SmartAllocation.c
+5
-3
ChgPro_ChgRun_SmartAllocation.c
DcPillar/Src/SmartAllocation/ChgPro_ChgRun_SmartAllocation.c
+4
-3
Drv_DcModule_SmartAllocation.c
DcPillar/Src/SmartAllocation/Drv_DcModule_SmartAllocation.c
+4
-2
Drv_SmartAllocation.c
DcPillar/Src/SmartAllocation/Drv_SmartAllocation.c
+75
-9
ChgPro_ChgIdle.c
DcPillar/Src/Thread/Charge/ChgPro_ChgIdle.c
+7
-1
ChgPro_B_ChgIdle.c
DcPillar/Src/Thread/Charge_B/ChgPro_B_ChgIdle.c
+7
-0
没有找到文件。
DcPillar/Src/Drivers/Drv_TCUComm.c
浏览文件 @
7618bb67
...
@@ -467,13 +467,13 @@ StructTCUCControl TCUControlInfo =
...
@@ -467,13 +467,13 @@ StructTCUCControl TCUControlInfo =
//硬件版本
//硬件版本
.
SoftwareVersion
=
.
SoftwareVersion
=
{
{
0xFF
,
0xff
,
(
u8
)(
__SoftVer__
>>
8
),
(
u8
)(
__SoftVer__
)
,
},
},
//软件版本
//软件版本
.
SoftwareData
=
.
SoftwareData
=
{
{
0x
FF
,
0xff
,
0xFF
,
0xFF
0x
20
,
0x20
,
0x06
,
0x08
},
},
//软件日期
//软件日期
...
...
DcPillar/Src/Global.h
浏览文件 @
7618bb67
...
@@ -406,7 +406,7 @@ extern u8 HexToBcd(u8 Hex);
...
@@ -406,7 +406,7 @@ extern u8 HexToBcd(u8 Hex);
extern
int
CopyCode
(
u32
Des
,
u32
Scr
,
u32
Len
);
extern
int
CopyCode
(
u32
Des
,
u32
Scr
,
u32
Len
);
extern
int
UpdateFlagSet
(
u32
Status
);
extern
int
UpdateFlagSet
(
u32
Status
);
#define __SoftVer__ (0x0
32
0) //BCD码 如:V1.02 SoftVer = 0x0102
#define __SoftVer__ (0x0
11
0) //BCD码 如:V1.02 SoftVer = 0x0102
#endif
#endif
DcPillar/Src/SmartAllocation/ChgPro_B_ChgRun_SmartAllocation.c
浏览文件 @
7618bb67
...
@@ -12,12 +12,13 @@
...
@@ -12,12 +12,13 @@
s32
GetChgVoltChgRun_B
(
void
)
s32
GetChgVoltChgRun_B
(
void
)
{
{
if
(
BcsMsg_B
.
Valid
)
return
BcsMsg_B
.
ChgVolt
;
if
(
ImdValue_B
.
Vaild
)
if
(
ImdValue_B
.
Vaild
)
return
ImdValue_B
.
PnVolt
;
return
ImdValue_B
.
PnVolt
;
//if(eMeterSta_Unavail != MeterComm.Status_B)
//if(eMeterSta_Unavail != MeterComm.Status_B)
// return MeterValue_B.Voltage;
// return MeterValue_B.Voltage;
if
(
BcsMsg_B
.
Valid
)
return
BcsMsg_B
.
ChgVolt
;
return
-
1
;
return
-
1
;
}
}
...
@@ -152,7 +153,8 @@ void ChgProChgRun_B(StructChargeCtrl_B *pChargeCtrl)
...
@@ -152,7 +153,8 @@ void ChgProChgRun_B(StructChargeCtrl_B *pChargeCtrl)
DcModuleManage_B
.
ValidNum
+=
DcModuleGroup
[
1
].
ValidNum
;
DcModuleManage_B
.
ValidNum
+=
DcModuleGroup
[
1
].
ValidNum
;
DcModuleGroup
[
1
].
flag
=
1
;
DcModuleGroup
[
1
].
flag
=
1
;
}
}
else
if
(
DcModuleGroup
[
0
].
status
==
Valid
)
else
if
(
DcModuleGroup
[
0
].
status
==
Valid
&&
ChargeCtrl
.
CurProcess
==
eChgPro_ChgIdle
)
{
{
DcModuleGroup
[
0
].
status
=
Hold_B
;
DcModuleGroup
[
0
].
status
=
Hold_B
;
DcModuleManage_B
.
ValidNum
+=
DcModuleGroup
[
0
].
ValidNum
;
DcModuleManage_B
.
ValidNum
+=
DcModuleGroup
[
0
].
ValidNum
;
...
...
DcPillar/Src/SmartAllocation/ChgPro_ChgRun_SmartAllocation.c
浏览文件 @
7618bb67
...
@@ -15,13 +15,13 @@
...
@@ -15,13 +15,13 @@
s32
GetChgVoltChgRun
(
void
)
s32
GetChgVoltChgRun
(
void
)
{
{
if
(
BcsMsg
.
Valid
)
return
BcsMsg
.
ChgVolt
;
if
(
ImdValue
.
Vaild
)
if
(
ImdValue
.
Vaild
)
return
ImdValue
.
PnVolt
;
return
ImdValue
.
PnVolt
;
//if(eMeterSta_Unavail != MeterComm.Status)
//if(eMeterSta_Unavail != MeterComm.Status)
// return MeterValue.Voltage;
// return MeterValue.Voltage;
if
(
BcsMsg
.
Valid
)
return
BcsMsg
.
ChgVolt
;
return
-
1
;
return
-
1
;
}
}
...
@@ -160,7 +160,8 @@ void ChgProChgRun(StructChargeCtrl * pChargeCtrl)
...
@@ -160,7 +160,8 @@ void ChgProChgRun(StructChargeCtrl * pChargeCtrl)
DcModuleManage
.
ValidNum
+=
DcModuleGroup
[
3
].
ValidNum
;
DcModuleManage
.
ValidNum
+=
DcModuleGroup
[
3
].
ValidNum
;
DcModuleGroup
[
3
].
flag
=
1
;
DcModuleGroup
[
3
].
flag
=
1
;
}
}
else
if
(
DcModuleGroup
[
2
].
status
==
Valid
)
else
if
(
DcModuleGroup
[
2
].
status
==
Valid
&&
ChargeCtrl_B
.
CurProcess
==
eChgPro_ChgIdle
)
{
{
DcModuleGroup
[
2
].
status
=
Hold_A
;
DcModuleGroup
[
2
].
status
=
Hold_A
;
DcModuleManage
.
ValidNum
+=
DcModuleGroup
[
2
].
ValidNum
;
DcModuleManage
.
ValidNum
+=
DcModuleGroup
[
2
].
ValidNum
;
...
...
DcPillar/Src/SmartAllocation/Drv_DcModule_SmartAllocation.c
浏览文件 @
7618bb67
...
@@ -265,12 +265,13 @@ void DcModuleSet(EnumSwitchStatus Set, u16 Volt, u16 Currt)
...
@@ -265,12 +265,13 @@ void DcModuleSet(EnumSwitchStatus Set, u16 Volt, u16 Currt)
DcModuleCtrl
.
NeedVolt
=
Volt
;
DcModuleCtrl
.
NeedVolt
=
Volt
;
DcModuleCtrl
.
NeedCurrt
=
Currt
;
DcModuleCtrl
.
NeedCurrt
=
Currt
;
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
if
(
DcModuleGroup
[
0
].
status
==
Hold_B
)
if
(
DcModuleGroup
[
0
].
status
==
Hold_B
)
{
{
DcModuleGroup
[
0
].
status
=
Hold_A
;
DcModuleGroup
[
0
].
status
=
Hold_A
;
DcModuleManage_B
.
ValidNum
-=
DcModuleGroup
[
0
].
ValidNum
;
DcModuleManage_B
.
ValidNum
-=
DcModuleGroup
[
0
].
ValidNum
;
DcModuleManage
.
ValidNum
+=
DcModuleGroup
[
0
].
ValidNum
;
DcModuleManage
.
ValidNum
+=
DcModuleGroup
[
0
].
ValidNum
;
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
}
else
if
(
DcModuleGroup
[
0
].
status
==
Valid
)
else
if
(
DcModuleGroup
[
0
].
status
==
Valid
)
{
{
...
@@ -386,12 +387,13 @@ void DcModuleSet_B(EnumSwitchStatus Set, u16 Volt, u16 Currt)
...
@@ -386,12 +387,13 @@ void DcModuleSet_B(EnumSwitchStatus Set, u16 Volt, u16 Currt)
DcModuleCtrl_B
.
NeedVolt
=
Volt
;
DcModuleCtrl_B
.
NeedVolt
=
Volt
;
DcModuleCtrl_B
.
NeedCurrt
=
Currt
;
DcModuleCtrl_B
.
NeedCurrt
=
Currt
;
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
if
(
DcModuleGroup
[
2
].
status
==
Hold_A
)
if
(
DcModuleGroup
[
2
].
status
==
Hold_A
)
{
{
DcModuleGroup
[
2
].
status
=
Hold_B
;
DcModuleGroup
[
2
].
status
=
Hold_B
;
DcModuleManage
.
ValidNum
-=
DcModuleGroup
[
2
].
ValidNum
;
DcModuleManage
.
ValidNum
-=
DcModuleGroup
[
2
].
ValidNum
;
DcModuleManage_B
.
ValidNum
+=
DcModuleGroup
[
2
].
ValidNum
;
DcModuleManage_B
.
ValidNum
+=
DcModuleGroup
[
2
].
ValidNum
;
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
}
else
if
(
DcModuleGroup
[
2
].
status
==
Valid
)
else
if
(
DcModuleGroup
[
2
].
status
==
Valid
)
{
{
...
...
DcPillar/Src/SmartAllocation/Drv_SmartAllocation.c
浏览文件 @
7618bb67
...
@@ -446,16 +446,17 @@ void DcModuleCtrlProcess_SmartAllocation(void)
...
@@ -446,16 +446,17 @@ void DcModuleCtrlProcess_SmartAllocation(void)
DcModuleGroup
[
i
].
flag
=
0
;
DcModuleGroup
[
i
].
flag
=
0
;
}
}
}
}
else
if
(
DcModuleGroup
[
i
].
status
==
Valid
&&
i
!=
2
&&
i
!=
0
)
else
if
(
DcModuleGroup
[
i
].
status
==
Valid
)
{
{
if
(
DcModuleGroup
[
i
].
Current
>
50
)
//电流小于5A,将降流完成, 可以释放继电器
if
(
DcModuleGroup
[
i
].
Current
>
50
)
//电流小于5A,将降流完成, 可以释放继电器
{
{
Temp
++
;
//if(i != 2 && i != 0)
Temp
++
;
//for (u8 j = 0; j < DcModuleGroup[i].num; j++)
//for (u8 j = 0; j < DcModuleGroup[i].num; j++)
{
{
//addr = DcModuleGroup[i].modules[j].addr;
//addr = DcModuleGroup[i].modules[j].addr;
//DcModuleGroup[i].modules[j].cmd = 0xAA;
//DcModuleGroup[i].modules[j].cmd = 0xAA;
SendCmdToDcModule
(
addr
,
0xAA
);
//关机
SendCmdToDcModule
(
i
,
0xAA
);
//关机
}
}
}
}
}
}
...
@@ -466,15 +467,80 @@ void DcModuleCtrlProcess_SmartAllocation(void)
...
@@ -466,15 +467,80 @@ void DcModuleCtrlProcess_SmartAllocation(void)
Temp
=
0
;
Temp
=
0
;
//切换继电器
//切换继电器
for
(
u8
i
=
0
;
i
<
DcModuleGroupSize
;
i
++
)
if
(
DcModuleGroup
[
0
].
status
==
Hold_A
)
{
if
(
DcModuleGroup
[
2
].
status
==
Hold_A
)
GPIO_SetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
else
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
else
if
(
DcModuleGroup
[
0
].
status
==
Hold_B
)
{
GPIO_SetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
else
{
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
if
(
DcModuleGroup
[
1
].
status
==
Hold_A
)
{
GPIO_ResetBits
(
RELAY_K7K8_Port
,
RELAY_K7K8_Pin
);
GPIO_SetBits
(
RELAY_K1K2_Port
,
RELAY_K1K2_Pin
);
}
else
if
(
DcModuleGroup
[
1
].
status
==
Hold_B
)
{
GPIO_ResetBits
(
RELAY_K1K2_Port
,
RELAY_K1K2_Pin
);
GPIO_SetBits
(
RELAY_K7K8_Port
,
RELAY_K7K8_Pin
);
}
else
{
GPIO_ResetBits
(
RELAY_K1K2_Port
,
RELAY_K1K2_Pin
);
GPIO_ResetBits
(
RELAY_K7K8_Port
,
RELAY_K7K8_Pin
);
}
if
(
DcModuleGroup
[
2
].
status
==
Hold_A
)
{
{
if
(
status1
[
i
]
!=
DcModuleGroup
[
i
].
status
)
GPIO_SetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
else
if
(
DcModuleGroup
[
2
].
status
==
Hold_B
)
{
if
(
DcModuleGroup
[
0
].
status
==
Hold_B
)
GPIO_SetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
else
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
else
{
GPIO_ResetBits
(
RELAY_K5K6_Port
,
RELAY_K5K6_Pin
);
}
if
(
DcModuleGroup
[
3
].
status
==
Hold_A
)
{
GPIO_ResetBits
(
RELAY_K9K10_Port
,
RELAY_K9K10_Pin
);
GPIO_SetBits
(
RELAY_K3K4_Port
,
RELAY_K3K4_Pin
);
}
else
if
(
DcModuleGroup
[
3
].
status
==
Hold_B
)
{
GPIO_ResetBits
(
RELAY_K3K4_Port
,
RELAY_K3K4_Pin
);
GPIO_SetBits
(
RELAY_K9K10_Port
,
RELAY_K9K10_Pin
);
}
else
{
GPIO_ResetBits
(
RELAY_K3K4_Port
,
RELAY_K3K4_Pin
);
GPIO_ResetBits
(
RELAY_K9K10_Port
,
RELAY_K9K10_Pin
);
}
/*for (u8 i = 0; i < DcModuleGroupSize; i++)
{
//if (status1[i] != DcModuleGroup[i].status)
{
{
if (DcModuleGroup[i].status == Valid)
if (DcModuleGroup[i].status == Valid)
{
{
//切换继电器
//切换继电器
if
(
status1
[
i
]
==
Hold_A
)
//
if (status1[i] == Hold_A)
{
{
if (i == 0)
if (i == 0)
{
{
...
@@ -493,7 +559,7 @@ void DcModuleCtrlProcess_SmartAllocation(void)
...
@@ -493,7 +559,7 @@ void DcModuleCtrlProcess_SmartAllocation(void)
GPIO_ResetBits(RELAY_K3K4_Port, RELAY_K3K4_Pin);
GPIO_ResetBits(RELAY_K3K4_Port, RELAY_K3K4_Pin);
}
}
}
}
else
if
(
status1
[
i
]
==
Hold_B
)
//
else if (status1[i] == Hold_B)
{
{
if (i == 2)
if (i == 2)
{
{
...
@@ -560,8 +626,8 @@ void DcModuleCtrlProcess_SmartAllocation(void)
...
@@ -560,8 +626,8 @@ void DcModuleCtrlProcess_SmartAllocation(void)
}
}
status1
[
i
]
=
DcModuleGroup
[
i
].
status
;
//
status1[i] = DcModuleGroup[i].status;
}
}
*/
/*if (LastFlag_A != DcModuleCtrl.CtrlFlag)
/*if (LastFlag_A != DcModuleCtrl.CtrlFlag)
...
...
DcPillar/Src/Thread/Charge/ChgPro_ChgIdle.c
浏览文件 @
7618bb67
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#include "Drv_DcModule.h"
#include "Drv_DcModule.h"
#include "Drv_BmsComm.h"
#include "Drv_BmsComm.h"
#include "Drv_Meter.h"
#include "Drv_Meter.h"
#include "Drv_SmartAllocation.h"
void
ChgProChgIdle
(
StructChargeCtrl
*
pChargeCtrl
)
void
ChgProChgIdle
(
StructChargeCtrl
*
pChargeCtrl
)
{
{
...
@@ -72,6 +72,12 @@ void ChgProChgIdle(StructChargeCtrl *pChargeCtrl)
...
@@ -72,6 +72,12 @@ void ChgProChgIdle(StructChargeCtrl *pChargeCtrl)
CcStatusChkTick
=
0
;
CcStatusChkTick
=
0
;
if
(
0
!=
TCUCurChgRecd
.
TCUChargeEnable
)
if
(
0
!=
TCUCurChgRecd
.
TCUChargeEnable
)
{
{
if
(
DcModuleGroup
[
0
].
status
==
Hold_B
)
{
DcModuleGroup
[
0
].
status
=
Valid
;
DcModuleGroup
[
0
].
flag
=
1
;
SendDataToDcModule_A
(
eSwSta_Off
,
DcModuleAbility
.
MinVolt
,
DcModuleAbility
.
MinCurrt
*
DcModuleManage
.
ValidNum
);
}
pChargeCtrl
->
CurProcess
=
eChgPro_ShakeHand
;
pChargeCtrl
->
CurProcess
=
eChgPro_ShakeHand
;
pChargeCtrl
->
Param
=
0
;
pChargeCtrl
->
Param
=
0
;
}
}
...
...
DcPillar/Src/Thread/Charge_B/ChgPro_B_ChgIdle.c
浏览文件 @
7618bb67
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include "Drv_DcModule.h"
#include "Drv_DcModule.h"
#include "Drv_BmsComm.h"
#include "Drv_BmsComm.h"
#include "Memory.h"
#include "Memory.h"
#include "Drv_SmartAllocation.h"
void
ChgProChgIdle_B
(
StructChargeCtrl_B
*
pChargeCtrl
)
void
ChgProChgIdle_B
(
StructChargeCtrl_B
*
pChargeCtrl
)
{
{
...
@@ -73,6 +74,12 @@ void ChgProChgIdle_B(StructChargeCtrl_B *pChargeCtrl)
...
@@ -73,6 +74,12 @@ void ChgProChgIdle_B(StructChargeCtrl_B *pChargeCtrl)
CcStatusChkTick
=
0
;
CcStatusChkTick
=
0
;
if
(
0
!=
TCUCurChgRecd_B
.
TCUChargeEnable
)
if
(
0
!=
TCUCurChgRecd_B
.
TCUChargeEnable
)
{
{
if
(
DcModuleGroup
[
2
].
status
==
Hold_A
)
{
DcModuleGroup
[
2
].
status
=
Valid
;
DcModuleGroup
[
2
].
flag
=
1
;
SendDataToDcModule_B
(
eSwSta_Off
,
DcModuleAbility
.
MinVolt
,
DcModuleAbility
.
MinCurrt
*
DcModuleManage
.
ValidNum
);
}
pChargeCtrl
->
CurProcess
=
eChgPro_B_ShakeHand
;
pChargeCtrl
->
CurProcess
=
eChgPro_B_ShakeHand
;
pChargeCtrl
->
Param
=
0
;
pChargeCtrl
->
Param
=
0
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论