Browse Source

底座控制器软件调试完成,可以使用

LAPTOP-KB7QFH2U\ChenJie-PC 1 year ago
parent
commit
da887a4aa4
2 changed files with 35 additions and 10 deletions
  1. 2 2
      HardwareLib/HardwareLib.h
  2. 33 8
      System/Vehicle/AppFunc.c

+ 2 - 2
HardwareLib/HardwareLib.h

@@ -227,8 +227,8 @@ DSM_stDiagE_TYPE PPWMDrv_GetChanDiagInfo(uint8 idxChanUB, DSM_idxDiagTypeE_TYPE
 /*应用层序号重新定义*/
 #define _PSWT_INDEX_X36 0      //高边驱动1,对应接插件X36,输入交流接触器控制
 #define _PSWT_INDEX_X32 1      //高边驱动2,对应接插件X32,A路BMS电源供电切换-B路
-#define _PSWT_INDEX_X28 2      //高边驱动3,对应接插件X28,A路24V常供电电源控制
-#define _PSWT_INDEX_X24 3      //高边驱动4,对应接插件X24,B路24V常供电电源控制
+#define _PSWT_INDEX_X28 2      //高边驱动3,对应接插件X28,B路24V常供电电源控制
+#define _PSWT_INDEX_X24 3      //高边驱动4,对应接插件X24,A路24V常供电电源控制
 #define _PSWT_INDEX_X20 4      //高边驱动5,对应接插件X20,A/B路控制输出切换
 #define _PSWT_INDEX_X16 5      //高边驱动6,对应接插件X16,A/B路 S+/S-切换
 #define _PSWT_INDEX_X12 6      //高边驱动7,对应接插件X12,A/B路电子锁控制切换

+ 33 - 8
System/Vehicle/AppFunc.c

@@ -18,15 +18,23 @@
 void GetDIOState(void)
 {
 	//配置高有效,底层悬空为0,触发为1,应用层输出悬空为0,触发为1
-	DINDrv_SetChanThres(_DIN_INDEX_X10, 0, 40950U);
-	DINDrv_SetChanThres(_DIN_INDEX_X17, 0, 40950U);
-	DINDrv_SetChanThres(_DIN_INDEX_X18, 0, 40950U);
-	DINDrv_SetChanThres(_DIN_INDEX_X13, 0, 40950U);
-	DINDrv_SetChanThres(_DIN_INDEX_X9, 0, 40950U);
-	DINDrv_SetChanThres(_DIN_INDEX_X5, 0, 40950U);
-	DINDrv_SetChanThres(_DIN_INDEX_X11, 0, 40950U);
-	DINDrv_SetChanThres(_DIN_INDEX_X14, 0, 40950U);
+//	DINDrv_SetChanThres(_DIN_INDEX_X10, 1, 40950U);
+//	DINDrv_SetChanThres(_DIN_INDEX_X17, 1, 40950U);
+//	DINDrv_SetChanThres(_DIN_INDEX_X18, 1, 40950U);
+//	DINDrv_SetChanThres(_DIN_INDEX_X13, 1, 40950U);
+//	DINDrv_SetChanThres(_DIN_INDEX_X9, 1, 40950U);
+//	DINDrv_SetChanThres(_DIN_INDEX_X5, 1, 40950U);
+//	DINDrv_SetChanThres(_DIN_INDEX_X11, 1, 40950U);
+//	DINDrv_SetChanThres(_DIN_INDEX_X14, 1, 40950U);
 
+	DINDrv_SetChanThres(_DIN_INDEX_X10, 1, (4095*3));
+	DINDrv_SetChanThres(_DIN_INDEX_X17, 1, (4095*3));
+	DINDrv_SetChanThres(_DIN_INDEX_X18, 1, (4095*3));
+	DINDrv_SetChanThres(_DIN_INDEX_X13, 1, (4095*3));
+	DINDrv_SetChanThres(_DIN_INDEX_X9, 1, (4095*3));
+	DINDrv_SetChanThres(_DIN_INDEX_X5, 1, (4095*3));
+	DINDrv_SetChanThres(_DIN_INDEX_X11, 1, (4095*3));
+	DINDrv_SetChanThres(_DIN_INDEX_X14, 1, (4095*3));
 	chrgModuelPwrCtlFB 		=DINDrv_GetChanState(_DIN_INDEX_X10);
 	paraChrgCtlFB 			=DINDrv_GetChanState(_DIN_INDEX_X17);
 	outToBaseCtlFB_A 		=DINDrv_GetChanState(_DIN_INDEX_X18);
@@ -67,6 +75,23 @@ void GetAIOValue(void)
 }
 void ctrlFunc(void)
 {
+	static uint8 A_volDetectTmp = 0;
+	static uint32 xk24_outputTime = 0;
+	if(A_volDetect==1)
+	{
+		A_volDetectTmp = A_volDetect;
+	}
+	if(A_volDetectTmp==1 && A_volDetect==0 && xk24_outputTime<3000)
+	{
+		PSwtDrv_Interface(_PSWT_INDEX_X24, 1);
+		xk24_outputTime = xk24_outputTime + 10;
+	}
+	if(xk24_outputTime>=3000)
+	{
+		xk24_outputTime = 0;
+		PSwtDrv_Interface(_PSWT_INDEX_X24, 0);
+		A_volDetectTmp = 0;
+	}
 	if(chrgModulePwrCtrl==1)
 	{
 		PSwtDrv_Interface(_PSWT_INDEX_X36, 1);