Browse Source

2020-06-20 / Alston Lin

Actions
1. Update the infy-power lib for enable or disable walk-in mode.

Files
1. As follow commit history.
Alston 4 years ago
parent
commit
a0120f95e0
1 changed files with 17 additions and 2 deletions
  1. 17 2
      EVSE/Modularization/Infypwr_PsuCommObj.c

+ 17 - 2
EVSE/Modularization/Infypwr_PsuCommObj.c

@@ -203,6 +203,19 @@ void ReceiveDataFromCanBus()
 
 			switch (intCmd)
 			{
+				case WALK_IN_MODE:
+				case INFYPWR_GROUP_SHIFT | WALK_IN_MODE:
+				{
+					//address = frame.can_id & 0x000000FF;
+//					printf("walk in response address = %d, [0] = %d, [1] = %d, [2] = %d, [3] = %d, [4] = %d, [5] = %d, [6] = %d, [7] = %d \n"
+//							, address,
+//							frame.data[0], frame.data[1],
+//							frame.data[2], frame.data[3],
+//							frame.data[4], frame.data[5],
+//							frame.data[6], frame.data[7]);
+				}
+					break;
+
 				case INFYPWR_GROUP_SHIFT | STATUS:
 				{
 					group = frame.data[2];
@@ -521,7 +534,7 @@ void FanNoiseInfo(byte group, byte value)
 void SetWalkInConfig(byte group, byte enable, byte sec)
 {
 	byte data[8];
-	uint cmd = INFYPWR_CMD | WALK_IN_MODE;  //0x180100E5
+	uint cmd = INFYPWR_CMD | WALK_IN_MODE;
 
 	memset(data, 0x00, ARRAY_SIZE(data));
 	unsigned short _Sec = sec * 100;
@@ -535,7 +548,9 @@ void SetWalkInConfig(byte group, byte enable, byte sec)
 	if (group == SYSTEM_CMD)
 		cmd |= INFYPWR_BROADCAST | INFYPWR_DEFAULT;
 	else
-		cmd |= INFYPWR_GROUP_SHIFT | (group << 8) | INFYPWR_DEFAULT;
+		cmd |= (group << 8) | INFYPWR_DEFAULT;
+
+	//printf("walk in cmd = %x \n", cmd);
 	SendCmdToPsu(cmd, data, sizeof(data));
 }