Przeglądaj źródła

2020-04-24 / Alston Lin

Actions
1. Change the UI layout
2. Modify the way to get the maximum charging energy
3. Support the AC charging gun process
4. Add GFD warning code
5. Save the PSU version for web page
6. Add limit to maximum charging current for each charging gun
7. Calculate the charging fee
8. Optimize the function of max-charging to average-charging

Files
1. As follow commit history
Alston 4 lat temu
rodzic
commit
b16aac4d1d
50 zmienionych plików z 38212 dodań i 36578 usunięć
  1. 42 16
      EVSE/Projects/DS60-120/Apps/Config.h
  2. BIN
      EVSE/Projects/DS60-120/Apps/FactoryConfig
  3. 7 2
      EVSE/Projects/DS60-120/Apps/FactoryConfig.c
  4. 2 7
      EVSE/Projects/DS60-120/Apps/Makefile
  5. BIN
      EVSE/Projects/DS60-120/Apps/Module_EvComm
  6. 53 18
      EVSE/Projects/DS60-120/Apps/Module_EvComm.c
  7. BIN
      EVSE/Projects/DS60-120/Apps/Module_EventLogging
  8. 4 2
      EVSE/Projects/DS60-120/Apps/Module_EventLogging.c
  9. BIN
      EVSE/Projects/DS60-120/Apps/Module_InternalComm
  10. 574 165
      EVSE/Projects/DS60-120/Apps/Module_InternalComm.c
  11. 70 32
      EVSE/Projects/DS60-120/Apps/Module_LcmContro.h
  12. BIN
      EVSE/Projects/DS60-120/Apps/Module_LcmControl
  13. 400 86
      EVSE/Projects/DS60-120/Apps/Module_LcmControl.c
  14. BIN
      EVSE/Projects/DS60-120/Apps/Module_PrimaryComm
  15. 18 7
      EVSE/Projects/DS60-120/Apps/Module_PrimaryComm.c
  16. BIN
      EVSE/Projects/DS60-120/Apps/Module_PsuComm
  17. 99 53
      EVSE/Projects/DS60-120/Apps/Module_PsuComm.c
  18. 3 0
      EVSE/Projects/DS60-120/Apps/Module_PsuComm.h
  19. BIN
      EVSE/Projects/DS60-120/Apps/ReadCmdline
  20. 266 77
      EVSE/Projects/DS60-120/Apps/ReadCmdline.c
  21. 320 11
      EVSE/Projects/DS60-120/Apps/internalComm.c
  22. 66 0
      EVSE/Projects/DS60-120/Apps/internalComm.h
  23. BIN
      EVSE/Projects/DS60-120/Apps/main
  24. 377 105
      EVSE/Projects/DS60-120/Apps/main.c
  25. 1 0
      EVSE/Projects/DS60-120/Apps/web.sh
  26. BIN
      EVSE/Projects/DS60-120/Images/FactoryDefaultConfig.bin
  27. BIN
      EVSE/Projects/DS60-120/Images/MLO
  28. BIN
      EVSE/Projects/DS60-120/Images/ramdisk.gz
  29. BIN
      EVSE/Projects/DS60-120/Images/u-boot.img
  30. BIN
      EVSE/Projects/DS60-120/Images/zImage
  31. 32722 32722
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_System.map
  32. 1413 1399
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_kallsyms1.S
  33. 1413 1399
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_kallsyms2.S
  34. BIN
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_vmlinux1
  35. BIN
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_vmlinux2
  36. 1 1
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.version
  37. 98 18
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/.am335x-evm.dtb.dts.tmp
  38. 80 35
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dts
  39. 6 13
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/lib/.gen_crc32table.cmd
  40. 13 31
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/scripts/.conmakehash.cmd
  41. 15 33
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/scripts/.kallsyms.cmd
  42. 13 36
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/scripts/.sortextable.cmd
  43. 5 10
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/scripts/basic/.bin2c.cmd
  44. 20 38
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/scripts/basic/.fixdep.cmd
  45. 14 33
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/scripts/mod/.mk_elfconfig.cmd
  46. 16 39
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/usr/.gen_init_cpio.cmd
  47. 20 38
      board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/scripts/basic/.fixdep.cmd
  48. 19 45
      board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/tools/.gen_eth_addr.cmd
  49. 19 45
      board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/tools/.img2srec.cmd
  50. 23 62
      board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/tools/.proftool.cmd

+ 42 - 16
EVSE/Projects/DS60-120/Apps/Config.h

@@ -10,7 +10,6 @@
 typedef unsigned char			byte;
 
 #define TOTAL_QUANTITY_GUN			4				//Max Count
-#define DEBUG						0
 
 #define MODE_BOOT					0
 #define MODE_IDLE					1
@@ -71,25 +70,51 @@ enum _SYSTEM_STATUS
 	S_NONE,
 };
 
+enum _AC_SYSTEM_STATUS
+{
+	AC_SYS_NONE = 	0,
+	AC_SYS_A,
+	AC_SYS_B,
+	AC_SYS_C,
+	AC_SYS_D,
+	AC_SYS_E
+};
+
 enum _GUN_TYPE
 {
 	_Type_Chademo = 		0,
 	_Type_CCS_2,
 	_Type_GB,
+	_Type_AC,
 };
 
+//enum _LCM_INDEX
+//{
+//	_LCM_INIT = 			0x00,
+//	_LCM_IDLE = 			0x01,
+//	_LCM_AUTHORIZING = 		0x04,
+//	_LCM_AUTHORIZ_COMP = 	0x05,
+//	_LCM_AUTHORIZ_FAIL = 	0x06,
+//	_LCM_WAIT_FOR_PLUG = 	0x07,
+//	_LCM_PRE_CHARGE = 		0x08,
+//	_LCM_CHARGING = 		0x09,
+//	_LCM_COMPLETE = 		0x0A,
+//	_LCM_FIX = 				0x0B,
+//	_LCM_NONE = 			0xFF,
+//};
+
 enum _LCM_INDEX
 {
 	_LCM_INIT = 			0x00,
 	_LCM_IDLE = 			0x01,
-	_LCM_AUTHORIZING = 		0x04,
-	_LCM_AUTHORIZ_COMP = 	0x05,
-	_LCM_AUTHORIZ_FAIL = 	0x06,
-	_LCM_WAIT_FOR_PLUG = 	0x07,
-	_LCM_PRE_CHARGE = 		0x08,
-	_LCM_CHARGING = 		0x09,
-	_LCM_COMPLETE = 		0x0A,
-	_LCM_FIX = 				0x0B,
+	_LCM_AUTHORIZING = 		0x02,
+	_LCM_AUTHORIZ_COMP = 	0x03,
+	_LCM_AUTHORIZ_FAIL = 	0x04,
+	_LCM_WAIT_FOR_PLUG = 	0x05,
+	_LCM_PRE_CHARGE = 		0x06,
+	_LCM_CHARGING = 		0x07,
+	_LCM_COMPLETE = 		0x08,
+	_LCM_FIX = 				0x09,
 	_LCM_NONE = 			0xFF,
 };
 
@@ -124,12 +149,6 @@ enum _OFFLINE_POLICY
 	_OFFLINE_POLICY_NO_CHARGING = 0x03,
 };
 
-enum _SYS_AUTHORIZE_MODE
-{
-	_SYS_AUTHORIZE_OCPP = 0x00,
-	_SYS_AUTHORIZE_FREE = 0x01
-};
-
 enum _REASSIGNED_RESOURCE_STEP
 {
 	_REASSIGNED_NONE = 				0,	//
@@ -154,7 +173,14 @@ enum _MAIN_CHARGING_MODE
 enum _EXTRA_ERR_PROCESS
 {
 	_EXTRA_ERR_PROCESS_NONE = 0,
-	_EXTRA_ERR_PROCESS_INUVP = 1
+	_EXTRA_ERR_PROCESS_INUVP = 1,
+	_EXTRA_ERR_PROCESS_INOVP = 2
+};
+
+enum _CHARGER_TYPE
+{
+	_CHARGER_TYPE_IEC = 0,
+	_CHARGER_TYPE_UL = 1,
 };
 
 #endif /* CONFIG_H_ */

BIN
EVSE/Projects/DS60-120/Apps/FactoryConfig


+ 7 - 2
EVSE/Projects/DS60-120/Apps/FactoryConfig.c

@@ -103,7 +103,7 @@ int main(int argc,char *argv[])
 	*/
 	//********** System **********// udhcpc -i eth1 -s ./dhcp_script/eth1.script
 	//
-	strcpy((char *)SysConfig.ModelName, "DSYE601J0EW2PH");
+	strcpy((char *)SysConfig.ModelName, "DSYE601J0EE2PH");
 	strcpy((char *)SysConfig.SerialNumber, "");
 
 	memset(SysConfig.SystemId, 0x00, sizeof(SysConfig.SystemId));
@@ -114,7 +114,7 @@ int main(int argc,char *argv[])
 	strcat((char *)SysConfig.SystemId, (char *)SysConfig.SerialNumber);
 
 	strcpy((char *)SysConfig.SystemDateTime, "");
-	SysConfig.AuthorisationMode = _SYS_AUTHORIZE_OCPP;
+	SysConfig.AuthorisationMode = AUTH_MODE_ENABLE;
 	SysConfig.DefaultLanguage = 0;
 	SysConfig.RfidCardNumEndian = 0;
 	SysConfig.AcPlugInTimes = 0;
@@ -122,10 +122,15 @@ int main(int argc,char *argv[])
 	SysConfig.Ccs1PlugInTime = 0;
 	SysConfig.Ccs2PlugInTimes = 0;
 	SysConfig.ChademoPlugInTimes = 0;
+	SysConfig.BillingData.isBilling = 0;
+	SysConfig.isAPP = 1;
+	SysConfig.isQRCode = 1;
+	SysConfig.isRFID = 1;
 	//********** Charging **********//
 	SysConfig.MaxChargingEnergy = 0;
 	SysConfig.MaxChargingCurrent = 200;		// ³Ì¤j¥i¿é¥X¹q¬y (¾ã¼Î)
 	SysConfig.MaxChargingDuration = 0;
+	SysConfig.AcMaxChargingCurrent = 32;
 	SysConfig.PhaseLossPolicy = 0;
 	for(unsigned char i = 0; i < 10; i++)
 		strcpy((char *)SysConfig.LocalWhiteCard, "");

+ 2 - 7
EVSE/Projects/DS60-120/Apps/Makefile

@@ -8,7 +8,7 @@ Internal485ProtocolLib = -L ../../../Modularization/Internal485Protocol -lIntern
 all: CopyFile apps
 #apps: Module_CSU Module_EvComm Module_EventLogging Module_InternalComm Module_LcmControl Module_PrimaryComm Module_PsuComm 
 # ReadCmdline kill.sh
-apps: MainTask EvCommTask EventLoggingTask InternalCommTask LcmControlTask PrimaryCommTask PsuCommTask ReadCmdlineTask WebService 4GTask FactoryConfigApp OtherTools
+apps: MainTask EvCommTask EventLoggingTask InternalCommTask LcmControlTask PrimaryCommTask PsuCommTask ReadCmdlineTask FactoryConfigApp OtherTools
 
 MainTask:
 	rm -f *.o
@@ -75,15 +75,10 @@ FactoryConfigApp:
 	$(CC) -o FactoryConfig FactoryConfig.o 
 	cp -f FactoryConfig ../Images/root
 
-WebService:
-	cp -f ../../../Modularization/WebService ../Images/root
-
-4GTask:
-	cp -f ../../../Modularization/Module_4g ../Images/root
-
 OtherTools:
 	cp -f init.sh ../Images/root
 	cp -f kill.sh ../Images/root
+	cp -f web.sh ../Images/root
 
 CopyFile: 
 	rm -rfv ../Images/root

BIN
EVSE/Projects/DS60-120/Apps/Module_EvComm


+ 53 - 18
EVSE/Projects/DS60-120/Apps/Module_EvComm.c

@@ -58,7 +58,7 @@ float _cur_2 = 0;
 // Chademo : 500V, GB : 750, CCS : 950V
 float maxChargingVol[2] = { 5000, 9500 };			// 限制最大充電電壓,如依照模塊則填上 0
 // 限制最大充電電流與能量透過 Web
-float maxChargingCur[2] = { 0, 0 };					// 限制最大充電電流,如依照模塊則填上 0
+float maxChargingCur[2] = { 2000, 2000 };			// 限制最大充電電流,如依照模塊則填上 0
 float maxChargingPow = 0;							// 限制最大充電能量,如依照模塊則填上 0
 
 // 槍資訊
@@ -149,7 +149,7 @@ void PRINTF_FUNC(char *string, ...)
 	vsnprintf(buffer, sizeof(buffer), string, args);
 	va_end(args);
 
-	if (DEBUG)
+	if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
 		printf("%s \n", buffer);
 	else
 		DEBUG_INFO("%s \n", buffer);
@@ -392,7 +392,7 @@ void AddrAssignment(byte *data)
 
 	if (gun_count == 1)
 		index = 0x01;
-	if (CheckUniqNumber(index))
+//	if (CheckUniqNumber(index))
 	{
 		PRINTF_FUNC("EV board id = %x \n", index);
 //		PRINTF_FUNC("target_number[0] = %x \n", target_number[0]);
@@ -409,7 +409,6 @@ void AddrAssignment(byte *data)
 void ClearAbnormalStatus_Chademo(byte gun_index)
 {
 	ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvCommFail = 0x00;
-	ShmStatusCodeData->InfoCode.InfoEvents.bits.PilotFault = 0x00;
 	ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryMalfun = 0x00;
 	ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoNoPermission = 0x00;
 	ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryIncompatibility = 0x00;
@@ -645,19 +644,17 @@ void ClearAbnormalStatus_CCS(byte gun_index)
 	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error = 0x00;
 	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error = 0x00;
 	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCpStatus_Error = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnexpectVolBeforeCharing_Error = 0x00;
 }
 
 void AbnormalStopAnalysis(byte gun_index, byte *errCode)
 {
 	char string[7];
-	sprintf(string, "%d%d%d%d%d%d", *(errCode + 5), *(errCode + 4), *(errCode + 3), *(errCode + 2), *(errCode + 1), *(errCode + 0));
+	sprintf(string, "%d%d%d%d%d%d", *(errCode + 0), *(errCode + 1), *(errCode + 2), *(errCode + 3), *(errCode + 4), *(errCode + 5));
 
-	//PRINTF_FUNC("NOTIFICATION_EV_STOP : Err Code = %s \n", string);
+	PRINTF_FUNC("NOTIFICATION_EV_STOP : Err Code = %s \n", string);
 
 	if (strcmp(string, "023700") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvCommFail = 0x01;
-	if (strcmp(string, "023701") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEvCommFail = 0x01;
-	if (strcmp(string, "023702") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.GbEvCommFail = 0x01;
-	if (strcmp(string, "023703") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.PilotFault = 0x01;
 	if (strcmp(string, "023704") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryMalfun = 0x01;
 	if (strcmp(string, "023705") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoNoPermission = 0x01;
 	if (strcmp(string, "023706") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryIncompatibility = 0x01;
@@ -692,6 +689,7 @@ void AbnormalStopAnalysis(byte gun_index, byte *errCode)
 	if (strcmp(string, "023735") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReCapBmsEqrCurrentExceed = 0x01;
 	if (strcmp(string, "023736") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown = 0x01;
 
+	if (strcmp(string, "023701") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEvCommFail = 0x01;
 	if (strcmp(string, "023737") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit = 0x01;
 	if (strcmp(string, "023738") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVShiftPosition = 0x01;
 	if (strcmp(string, "023739") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargerConnectorLockFault = 0x01;
@@ -825,7 +823,9 @@ void AbnormalStopAnalysis(byte gun_index, byte *errCode)
 	if (strcmp(string, "023887") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error = 0x01;
 	if (strcmp(string, "023888") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error = 0x01;
 	if (strcmp(string, "023889") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCpStatus_Error = 0x01;
+	if (strcmp(string, "023890") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnexpectVolBeforeCharing_Error = 0x01;
 
+	if (strcmp(string, "023702") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.GbEvCommFail = 0x01;
 	if (strcmp(string, "023900") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_LOS_CC1 = 0x01;
 	if (strcmp(string, "023901") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CONNECTOR_LOCK_FAIL = 0x01;
 	if (strcmp(string, "023902") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BATTERY_INCOMPATIBLE = 0x01;
@@ -900,6 +900,7 @@ void CANReceiver()
 		int nbytes;
 		struct can_frame frame;
 		int intCmd;
+
 		// 槍資訊
 		struct ChargingInfoData *_chargingData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
 		struct timeval _cmd_ack_timeout[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
@@ -977,6 +978,9 @@ void CANReceiver()
 				{
 					case NOTIFICATION_EV_STATUS:
 					{
+						if (_chargingData[targetGun]->ConnectorPlugIn != frame.data[0])
+							PRINTF_FUNC("index = %d, ConnectorPlugIn = %x, data[0] = %x \n", targetGun, _chargingData[targetGun]->ConnectorPlugIn, frame.data[0]);
+
 						_chargingData[targetGun]->ConnectorPlugIn = frame.data[0];
 						_chargingData[targetGun]->PilotVoltage = frame.data[1];
 
@@ -1007,6 +1011,11 @@ void CANReceiver()
 								PRINTF_FUNC("CCS FW = %s \n", ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index].version);
 							}
 						}
+
+						if (targetGun == 1)
+							memcpy(ShmSysConfigAndInfo->SysInfo.Connector1FwRev, frame.data, ARRAY_SIZE(frame.data));
+						else
+							memcpy(ShmSysConfigAndInfo->SysInfo.Connector2FwRev, frame.data, ARRAY_SIZE(frame.data));
 					}
 						break;
 					case ACK_EV_HW_VERSION:
@@ -1133,7 +1142,7 @@ void CANReceiver()
 					{
 						// 車端要求停止
 						// frame.data[0] : 0x01 => normal stop, 0x02 => ev emergency stop
-						//PRINTF_FUNC("NOTIFICATION_EV_STOP err level = %d-----------------------------\n", frame.data[0]);
+						PRINTF_FUNC("(%d) NOTIFICATION_EV_STOP err level = %d-----------------------------\n", targetGun, frame.data[0]);
 						if (frame.data[0] == 0x02)
 						{
 							AbnormalStopAnalysis(targetGun, frame.data + 1);
@@ -1178,10 +1187,10 @@ void SetPresentChargingOutputPower(struct ChargingInfoData *chargingData_1, stru
 	//PRINTF_FUNC("***********************f cur - 1 = %f \n", chargingData_2->PresentChargingCurrent);
 
 	vol1 = chargingData_1->FireChargingVoltage;
-	cur1 = chargingData_1->PresentChargingCurrent;
+	cur1 = (chargingData_1->PresentChargingCurrent * 10);
 
 	vol2 = chargingData_2->FireChargingVoltage;
-	cur2 = chargingData_2->PresentChargingCurrent;
+	cur2 = (chargingData_2->PresentChargingCurrent * 10);
 
 	SetPresentOutputPower(vol1, cur1, vol2, cur2);
 }
@@ -1211,9 +1220,17 @@ void SetPresentChargingOutputCap(struct ChargingInfoData *chargingData_1, struct
 		_pow_2 != pow2 ||
 		_cur_2 != cur2)
 	{
-		PRINTF_FUNC("To EV Power_1 = %f, Cur_1 = %f, Power_2 = %f, Cur_2 = %f \n",
+		PRINTF_FUNC("To EV (Real) Power_1 = %f, Cur_1 = %f, Power_2 = %f, Cur_2 = %f \n",
 				pow1, cur1, pow2, cur2);
 		_pow_1 = pow1; _cur_1 = cur1; _pow_2 = pow2; _cur_2 = cur2;
+		chargingData_1->RealMaxCurrent = _cur_1;
+		chargingData_1->RealMaxPower = pow1;
+
+		if (gun_count == 2)
+		{
+			chargingData_2->RealMaxCurrent = cur2;
+			chargingData_2->RealMaxPower = pow2;
+		}
 	}
 
 	SetPresentOutputCapacity(pow1, cur1, pow2, cur2);
@@ -1414,7 +1431,7 @@ int main(int argc, char *argv[])
 				GetMiscellaneousInfo(_index,
 						_chargingData[_index]->RelayK1K2Status,
 						_chargingData[_index]->PresentChargedEnergy,
-						_chargingData[_index]->PresentChargingVoltage,
+						(_chargingData[_index]->PresentChargingVoltage * 10),
 						_chargingData[_index]->Evboard_id);
 			}
 
@@ -1426,6 +1443,7 @@ int main(int argc, char *argv[])
 					_chargingData[_index]->PresentChargingPower = 0;
 					_chargingData[_index]->GroundFaultStatus = GFD_WAIT;
 					_chargingData[_index]->StopChargeFlag = NO;
+					_chargingData[_index]->ChargingFee = 0.0;
 					chargingTime[_index] = 0;
 
 					if (_chargingData[_index]->Type == _Type_Chademo)
@@ -1443,7 +1461,7 @@ int main(int argc, char *argv[])
 
 					if (priorityLow == 1)
 					{
-						maxChargingCur[_index] = ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10;
+						//maxChargingCur[_index] = ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10;
 						maxChargingPow = (ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10);
 					}
 					break;
@@ -1484,6 +1502,8 @@ int main(int argc, char *argv[])
 
 						PRINTF_FUNC("To EV_%d Max_Vol = %f, Cap_Cur = %f, Cap_Pow = %f \n",
 								_index, maxVol, maxCur, _chargingData[_index]->AvailableChargingPower);
+						_chargingData[_index]->RealMaxVoltage = maxVol;
+
 						SetChargingPermission(_index, START,
 						_chargingData[_index]->AvailableChargingPower,
 								maxCur,
@@ -1521,9 +1541,18 @@ int main(int argc, char *argv[])
 					if (priorityLow == 1)
 					{
 						// 拉 500 V 如果在一秒鐘內 GFD 都符合則 PASS
+//						if (_chargingData[_index]->FireChargingVoltage >= 3500)
+//							_chargingData[_index]->GroundFaultStatus = GFD_PASS;
+
+						//PRINTF_FUNC("To EV_%d GFD = %d \n",	_index, _chargingData[_index]->GroundFaultStatus);
 						if(_chargingData[_index]->GroundFaultStatus != GFD_WAIT)
 						{
-							SetIsolationStatus(_index, _chargingData[_index]->GroundFaultStatus, _chargingData[_index]->Evboard_id);
+							unsigned char _result = _chargingData[_index]->GroundFaultStatus;
+
+							if (_result == GFD_WARNING)
+								_result = GFD_PASS;
+
+							SetIsolationStatus(_index, _result, _chargingData[_index]->Evboard_id);
 						}
 
 						if(_chargingData[_index]->SystemStatus == S_CCS_PRECHARGE_ST0 &&
@@ -1537,7 +1566,7 @@ int main(int argc, char *argv[])
 				case S_CHARGING:
 				{
 					// 計算 Power
-					_chargingData[_index]->PresentChargingPower = ((float)((_chargingData[_index]->PresentChargingVoltage / 10) * (_chargingData[_index]->PresentChargingCurrent / 10)) / 1000);
+					_chargingData[_index]->PresentChargingPower = ((float)((_chargingData[_index]->PresentChargingVoltage) * (_chargingData[_index]->PresentChargingCurrent)) / 1000);
 
 					if (chargingTime[_index] == 0)
 					{
@@ -1549,7 +1578,13 @@ int main(int argc, char *argv[])
 
 						if (passTime > 0)
 						{
-							_chargingData[_index]->PresentChargedEnergy += (_chargingData[_index]->PresentChargingPower) * passTime / 3600;
+							float changingPow = (_chargingData[_index]->PresentChargingPower) * passTime / 3600;
+							if (ShmSysConfigAndInfo->SysConfig.BillingData.isBilling)
+							{
+								_chargingData[_index]->ChargingFee += changingPow * ShmSysConfigAndInfo->SysConfig.BillingData.Cur_fee;
+							}
+
+							_chargingData[_index]->PresentChargedEnergy += changingPow;
 							chargingTime[_index] = _chargingData[_index]->RemainChargingDuration;
 						}
 					}

BIN
EVSE/Projects/DS60-120/Apps/Module_EventLogging


+ 4 - 2
EVSE/Projects/DS60-120/Apps/Module_EventLogging.c

@@ -31,6 +31,8 @@
 #define ARRAY_SIZE(A)		(sizeof(A) / sizeof(A[0]))
 #define PASS				1
 #define FAIL				-1
+#define YES					1
+#define NO					0
 
 struct SysConfigAndInfo			*ShmSysConfigAndInfo;
 struct StatusCodeData 			*ShmStatusCodeData;
@@ -84,7 +86,7 @@ void PRINTF_FUNC(char *string, ...)
 	vsnprintf(buffer, sizeof(buffer), string, args);
 	va_end(args);
 
-	if (DEBUG)
+	if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
 		printf("%s \n", buffer);
 	else
 		DEBUG_INFO("%s \n", buffer);
@@ -254,7 +256,7 @@ int main(void)
 		}
 
 		//check Alarm Status
-		for(ByteCount=0;ByteCount<12;ByteCount++)
+		for(ByteCount=0;ByteCount<13;ByteCount++)
 		{
 			if(ShmStatusCodeData->AlarmCode.AlarmEvents.AlarmVal[ByteCount] != ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount])
 			{

BIN
EVSE/Projects/DS60-120/Apps/Module_InternalComm


Plik diff jest za duży
+ 574 - 165
EVSE/Projects/DS60-120/Apps/Module_InternalComm.c


+ 70 - 32
EVSE/Projects/DS60-120/Apps/Module_LcmContro.h

@@ -41,6 +41,8 @@ struct SysConfigAndInfo			*ShmSysConfigAndInfo;
 struct StatusCodeData 			*ShmStatusCodeData;
 struct FanModuleData			*ShmFanModuleData;
 
+#define	NO_DEFINE			255
+
 #define CMD_TITLE_1				0x5A
 #define CMD_TITLE_2				0xA5
 #define CMD_READ				0x80
@@ -51,19 +53,36 @@ struct FanModuleData			*ShmFanModuleData;
 #define CMD_BACKLIGHT			0x01
 #define CMD_REGISTER			0x03
 
+enum _BATTERY_LEVEL_FOR_MAP
+{
+	_BATTERY_LEVEL_FOR_MAP_EMP = 0x00,
+	_BATTERY_LEVEL_FOR_MAP_LV1 = 0x01,
+	_BATTERY_LEVEL_FOR_MAP_LV2 = 0x02,
+	_BATTERY_LEVEL_FOR_MAP_LV3 = 0x03,
+	_BATTERY_LEVEL_FOR_MAP_LV4 = 0x04,
+	_BATTERY_LEVEL_FOR_MAP_LV5 = 0x05,
+};
+
 int _port;
 //char* pPortName = "/dev/ttyO2";
 char* pPortName = "/dev/ttyS3";
 char* moduleName = "DMT80480T070_09WT";
 byte _totalCount;
+byte acgunCount;
 struct ChargingInfoData *_chargingInfoData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
+struct ChargingInfoData *ac_chargingInfo[AC_QUANTITY];
 
+byte ac_ani_battery_level = _BATTERY_LEVEL_FOR_MAP_LV5;
+byte isDiffStatus = false;
+byte isChangeBattMap = false;
 // ·í«e¿ï¾Üªººj¸¹
 short _currentPage = _LCM_NONE;
+short _oldPage = _LCM_NONE;
 byte _gunIndex = 0;
 byte _idlePageRotate = 1;
 bool _backend_conn_status = false;
 bool _wifi_conn_status = false;
+bool _battery_display_ani = false;
 
 // LCM - HW
 byte _everyPageRollChange = 0;
@@ -75,17 +94,21 @@ short __sel_gun_btn = 0x0040;
 short __ret_home_btn = 0x0042;
 short __stop_method_btn = 0x0044;
 
-short __qr_code = 0x0050;
+short __qr_code = 0x0250;
+short __main_rfid = 0x0052;
+short __main_qr = 0x0054;
+short __main_app = 0x0056;
 
 short __plug_in_arrow = 0x0060;
 
 short __conn_line = 0x0066;
 
 short __gun_type_index = 0x0070;
-short __qr_code_pre = 0x0080;
+short __qr_code_pre = 0x0280;
 
 short __side_top = 0x0090;
 short __side_down = 0x0092;
+short __side_mid = 0x0094;
 
 short __conn_line_chag = 0x0096;
 short __batt_map = 0x0100;
@@ -97,6 +120,12 @@ short __remain_time_tx = 0x0110;
 short __output_eng_tx = 0x0120;
 short __total_out_eng_tx = 0x0130;
 short __conn_line_comp = 0x0140;
+short __charging_fee_map = 0x0146;
+short __charging_fee_tx = 0x0150;
+
+short __money_by_rate = 0x0200;
+short __money_rate = 0x0220;
+short __money_rate_map = 0x0230;
 
 // ICON ID
 byte _disappear = 0;
@@ -118,34 +147,43 @@ byte _stop_charging_btn = 15;
 byte _stop_charging_btn_scan = 16;
 byte _chademo_dark = 17;
 byte _ccs_dark = 18;
-byte _actype_dark = 19;
-byte _chademo_light = 20;
-byte _ccs_light = 21;
-byte _actype_light = 22;
-byte _side_rfid_1 = 23;
-byte _side_qr_1 = 24;
-byte _side_app_1 = 25;
-byte _side_rfid_2 = 26;
-byte _side_qr_2 = 27;
-byte _side_app_2 = 28;
-byte _charging_map1 = 29;
-byte _charging_map2 = 30;
-byte _battery_cap_20 = 31;
-byte _battery_cap_40 = 32;
-byte _battery_cap_60 = 33;
-byte _battery_cap_80 = 34;
-byte _battery_cap_100 = 35;
-byte _battery_map = 36;
-byte _power_map = 37;
-byte _time_map = 38;
-byte _complete_map = 39;
-byte _battery_soc_20 = 40;
-byte _battery_soc_40 = 41;
-byte _battery_soc_60 = 42;
-byte _battery_soc_80 = 43;
-byte _battery_soc_100 = 44;
-byte _battery_eng_map = 45;
-byte _money_map = 46;
-byte _elapse_time_map = 47;
-
+byte _gbt_dark = 19;
+byte _actype_dark = 20;
+byte _chademo_light = 21;
+byte _ccs_light = 22;
+byte _gbt_light = 23;
+byte _actype_light = 24;
+byte _main_none_rfid = 25;
+byte _main_rfid = 26;
+byte _main_none_app = 27;
+byte _main_app = 28;
+byte _main_none_qr = 29;
+byte _main_qr = 30;
+byte _charging_map1 = 31;
+byte _charging_map2 = 32;
+byte _battery_empty = 33;
+byte _battery_cap_20 = 34;
+byte _battery_cap_40 = 35;
+byte _battery_cap_60 = 36;
+byte _battery_cap_80 = 37;
+byte _battery_cap_100 = 38;
+byte _battery_map = 39;
+byte _power_map = 40;
+byte _time_map = 41;
+byte _complete_map = 42;
+byte _battery_soc_20 = 43;
+byte _battery_soc_40 = 44;
+byte _battery_soc_60 = 45;
+byte _battery_soc_80 = 46;
+byte _battery_soc_100 = 47;
+byte _battery_eng_map = 48;
+byte _money_map = 49;
+byte _elapse_time_map = 50;
+byte _charging_money = 51;
+byte _side_none_rfid = 52;
+byte _side_rfid = 53;
+byte _side_none_app = 54;
+byte _side_app = 55;
+byte _side_none_qr = 56;
+byte _side_qr = 57;
 

BIN
EVSE/Projects/DS60-120/Apps/Module_LcmControl


+ 400 - 86
EVSE/Projects/DS60-120/Apps/Module_LcmControl.c

@@ -1,5 +1,7 @@
 #include "Module_LcmContro.h"
 
+bool needReloadQr = true;
+
 void PRINTF_FUNC(char *string, ...);
 
 int StoreLogMsg(const char *fmt, ...);
@@ -57,7 +59,7 @@ void PRINTF_FUNC(char *string, ...)
 	vsnprintf(buffer, sizeof(buffer), string, args);
 	va_end(args);
 
-	if (DEBUG)
+	if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
 		printf("%s \n", buffer);
 	else
 		DEBUG_INFO("%s \n", buffer);
@@ -469,6 +471,81 @@ bool FindChargingInfoData(byte target, struct ChargingInfoData **_chargingData)
 	return false;
 }
 
+bool FindAcChargingInfoData(byte target, struct ChargingInfoData **acChargingData)
+{
+	if (target < AC_QUANTITY)
+	{
+		acChargingData[target] = &ShmSysConfigAndInfo->SysInfo.AcChargingData[target];
+		return true;
+	}
+
+	return false;
+}
+
+void ChangeAcBattMapAndValue(short page)
+{
+	if (page == _LCM_CHARGING)
+	{
+		if (isDiffStatus != _battery_display_ani)
+		{
+			isChangeBattMap = false;
+			isDiffStatus = _battery_display_ani;
+		}
+
+		if (ac_chargingInfo[0]->IsCharging && !isChangeBattMap)
+		{
+			isChangeBattMap = true;
+			if (ac_ani_battery_level == _BATTERY_LEVEL_FOR_MAP_LV5)
+			{
+				ChangeDisplay2Value(__batt_map, _battery_empty);
+				ac_ani_battery_level = _BATTERY_LEVEL_FOR_MAP_EMP;
+			}
+			else if (ac_ani_battery_level == _BATTERY_LEVEL_FOR_MAP_EMP)
+			{
+				ChangeDisplay2Value(__batt_map, _battery_cap_20);
+				ac_ani_battery_level = _BATTERY_LEVEL_FOR_MAP_LV1;
+			}
+			else if (ac_ani_battery_level == _BATTERY_LEVEL_FOR_MAP_LV1)
+			{
+				ChangeDisplay2Value(__batt_map, _battery_cap_40);
+				ac_ani_battery_level = _BATTERY_LEVEL_FOR_MAP_LV2;
+			}
+			else if (ac_ani_battery_level == _BATTERY_LEVEL_FOR_MAP_LV2)
+			{
+				ChangeDisplay2Value(__batt_map, _battery_cap_60);
+				ac_ani_battery_level = _BATTERY_LEVEL_FOR_MAP_LV3;
+			}
+			else if (ac_ani_battery_level == _BATTERY_LEVEL_FOR_MAP_LV3)
+			{
+				ChangeDisplay2Value(__batt_map, _battery_cap_80);
+				ac_ani_battery_level = _BATTERY_LEVEL_FOR_MAP_LV4;
+			}
+			else if (ac_ani_battery_level == _BATTERY_LEVEL_FOR_MAP_LV4)
+			{
+				ChangeDisplay2Value(__batt_map, _battery_cap_100);
+				ac_ani_battery_level = _BATTERY_LEVEL_FOR_MAP_LV5;
+			}
+		}
+	}
+	else if (page == _LCM_COMPLETE)
+	{
+		if (ac_ani_battery_level == _BATTERY_LEVEL_FOR_MAP_LV5)
+			ChangeDisplay2Value(__batt_map, _battery_soc_20);
+		else if (ac_ani_battery_level == _BATTERY_LEVEL_FOR_MAP_EMP)
+			ChangeDisplay2Value(__batt_map, _battery_soc_20);
+		else if (ac_ani_battery_level == _BATTERY_LEVEL_FOR_MAP_LV1)
+			ChangeDisplay2Value(__batt_map, _battery_soc_40);
+		else if (ac_ani_battery_level == _BATTERY_LEVEL_FOR_MAP_LV2)
+			ChangeDisplay2Value(__batt_map, _battery_soc_60);
+		else if (ac_ani_battery_level == _BATTERY_LEVEL_FOR_MAP_LV3)
+			ChangeDisplay2Value(__batt_map, _battery_soc_80);
+		else if (ac_ani_battery_level == _BATTERY_LEVEL_FOR_MAP_LV4)
+			ChangeDisplay2Value(__batt_map, _battery_soc_100);
+	}
+
+	ChangeDisplay2Value(__soc_value_charging, _disappear);
+}
+
 void ChangeBattMapAndValue(short page, int soc)
 {
 //	srand(time(NULL));
@@ -479,13 +556,33 @@ void ChangeBattMapAndValue(short page, int soc)
 	if (page == _LCM_CHARGING)
 	{
 		if (soc < 20)
-			ChangeDisplay2Value(__batt_map, _battery_cap_20);
+		{
+			if (_battery_display_ani)
+				ChangeDisplay2Value(__batt_map, _battery_empty);
+			else
+				ChangeDisplay2Value(__batt_map, _battery_cap_20);
+		}
 		else if (soc >= 20 && soc < 40)
-			ChangeDisplay2Value(__batt_map, _battery_cap_40);
+		{
+			if (_battery_display_ani)
+				ChangeDisplay2Value(__batt_map, _battery_cap_20);
+			else
+				ChangeDisplay2Value(__batt_map, _battery_cap_40);
+		}
 		else if (soc >= 40 && soc < 60)
-			ChangeDisplay2Value(__batt_map, _battery_cap_60);
+		{
+			if (_battery_display_ani)
+				ChangeDisplay2Value(__batt_map, _battery_cap_40);
+			else
+				ChangeDisplay2Value(__batt_map, _battery_cap_60);
+		}
 		else if (soc >= 60 && soc < 80)
-			ChangeDisplay2Value(__batt_map, _battery_cap_80);
+		{
+			if (_battery_display_ani)
+				ChangeDisplay2Value(__batt_map, _battery_cap_60);
+			else
+				ChangeDisplay2Value(__batt_map, _battery_cap_80);
+		}
 		else if (soc >= 80 && soc <= 100)
 			ChangeDisplay2Value(__batt_map, _battery_cap_100);
 	}
@@ -540,7 +637,8 @@ void ChangeChargingEnergyValue(float energy)
 	byte value[10];
 
 	memset(cmd, 0x00, sizeof(cmd));
-
+	if (energy >= 0.05)
+		energy -= 0.05;
 	sprintf((char *) value, "%.1f kWh", energy);
 	string2ByteArray(value, cmd);
 	DisplayValueToLcm(__total_out_eng_tx, cmd, sizeof(cmd));
@@ -556,15 +654,45 @@ void ChangeChargingPowerValue(float pow)
 //	float min = 0.0;
 //	float max = 50;
 //	pow = (max - min) * rand() / (RAND_MAX + 1.0) + min;
-
 	sprintf((char *) value, "%.1f kW", pow);
 	string2ByteArray(value, cmd);
 	DisplayValueToLcm(__output_eng_tx, cmd, sizeof(cmd));
 }
 
-void ChangeStopMap(byte value)
+void ChangeChargingFeeValue(float fee)
 {
+	byte cmd[10];
+	byte value[10];
 
+	memset(cmd, 0x00, sizeof(cmd));
+
+	sprintf((char *) value, "%.2f", fee);
+	string2ByteArray(value, cmd);
+	DisplayValueToLcm(__charging_fee_tx, cmd, sizeof(cmd));
+}
+
+void DisplayMoneyRate(float money)
+{
+	byte cmd[8];
+	byte value[8];
+
+	memset(cmd, 0x00, sizeof(cmd));
+
+	sprintf((char *) value, "%.2f", money);
+	string2ByteArray(value, cmd);
+	DisplayValueToLcm(__money_by_rate, cmd, sizeof(cmd));
+}
+
+void DisplayMoneyCur(byte *cur)
+{
+	byte cmd[5];
+	byte buf[5];
+
+	*(cur + 3) = '\0';
+	memset(cmd, 0x00, sizeof(cmd));
+	sprintf((char *) buf, "%s", cur);
+	string2ByteArray(buf, cmd);
+	DisplayValueToLcm(__money_rate, cmd, sizeof(cmd));
 }
 
 void RefreshPageAnimation(byte value)
@@ -573,20 +701,7 @@ void RefreshPageAnimation(byte value)
 	{
 		case _LCM_IDLE:
 		{
-			if (value == 0)
-			{
-				ChangeToOtherPage(_currentPage);
-			}
-			else if (value == 15)
-			{
-				ChangeToOtherPage(_currentPage + 1);
-			}
-			else if (value == 30)
-			{
-				ChangeToOtherPage(_currentPage + 2);
-			}
 
-			_everyPageRollChange > 45 ? _everyPageRollChange = 0 : _everyPageRollChange++;
 		}
 			break;
 		case _LCM_WAIT_FOR_PLUG:
@@ -623,51 +738,6 @@ void RefreshPageAnimation(byte value)
 					ChangeDisplay2Value(__conn_line_comp, _complete_map);
 			}
 
-			if (_totalCount == 2 && _currentPage != _LCM_PRE_CHARGE)
-			{
-				byte index = 0;
-				for (index = 0; index < _totalCount; index++) {
-					if (ShmSysConfigAndInfo->SysInfo.CurGunSelected != index)
-					{
-						break;
-					}
-				}
-
-				ChangeDisplay2Value(__sel_gun_btn, _sel_gun_btn);
-				if (_chargingInfoData[index]->SystemStatus == S_IDLE ||
-						_chargingInfoData[index]->SystemStatus == S_RESERVATION)
-				{
-					if(value == 0)
-					{
-						ChangeDisplay2Value(__side_top, _side_rfid_1);
-						ChangeDisplay2Value(__side_down, _side_rfid_2);
-					}
-					else if (value == 15)
-					{
-						ChangeDisplay2Value(__side_top, _side_qr_1);
-						ChangeDisplay2Value(__side_down, _side_qr_2);
-					}
-					else if (value == 30)
-					{
-						ChangeDisplay2Value(__side_top, _side_app_1);
-						ChangeDisplay2Value(__side_down, _side_app_2);
-					}
-				}
-				else
-				{
-					ChangeDisplay2Value(__side_top, _disappear);
-					ChangeDisplay2Value(__side_down, _disappear);
-					ChangeDisplay2Value(__qr_code_pre, _disappear);
-				}
-			}
-			else
-			{
-				ChangeDisplay2Value(__sel_gun_btn, _disappear);
-				ChangeDisplay2Value(__side_top, _disappear);
-				ChangeDisplay2Value(__side_down, _disappear);
-				ChangeDisplay2Value(__qr_code_pre, _disappear);
-			}
-
 			_everyPageRollChange >= 45 ? _everyPageRollChange = 0 : _everyPageRollChange++;
 		}
 			break;
@@ -708,28 +778,178 @@ void RefreshConnStatus()
 		ChangeDisplay2Value(__conn_status, _disconnect);
 }
 
+byte FirstPageChanged()
+{
+	byte result = NO;
+
+	if (_currentPage != _oldPage)
+	{
+		result = YES;
+		_oldPage = _currentPage;
+	}
+
+	return result;
+}
+
 void ProcessPageInfo()
 {
 	switch(_currentPage)
 	{
 		case _LCM_IDLE:
 		{
-			// QR Code ³B²z
-			ChangeQrCode_Idle("http://google.com.tw");
+			if (ShmSysConfigAndInfo->SysConfig.isRFID)
+				ChangeDisplay2Value(__main_rfid, _main_rfid);
+			else
+				ChangeDisplay2Value(__main_rfid, _main_none_rfid);
+
+			if (ShmSysConfigAndInfo->SysConfig.isQRCode)
+				ChangeDisplay2Value(__main_qr, _main_qr);
+			else
+			{
+				ChangeDisplay2Value(__qr_code, _disappear);
+				ChangeDisplay2Value(__main_qr, _main_none_qr);
+				needReloadQr = true;
+			}
+
+			if (ShmSysConfigAndInfo->SysConfig.isAPP)
+				ChangeDisplay2Value(__main_app, _main_app);
+			else
+				ChangeDisplay2Value(__main_app, _main_none_app);
+
+			if (FirstPageChanged() == YES || needReloadQr)
+			{
+				if (ShmSysConfigAndInfo->SysConfig.isQRCode)
+				{
+					needReloadQr = false;
+					ChangeQrCode_Idle("http://google.com.tw");
+				}
+			}
+		}
+			break;
+		case _LCM_AUTHORIZING:
+		case _LCM_AUTHORIZ_COMP:
+		case _LCM_AUTHORIZ_FAIL:
+		case _LCM_WAIT_FOR_PLUG:
+		{
+			FirstPageChanged();
 		}
 			break;
 		case _LCM_PRE_CHARGE:
 		case _LCM_CHARGING:
 		case _LCM_COMPLETE:
 		{
-			// gun type and charging info
+			if (_totalCount + acgunCount >= 2)
+			{
+				if (ShmSysConfigAndInfo->SysConfig.isRFID)
+					ChangeDisplay2Value(__side_top, _side_rfid);
+				else
+					ChangeDisplay2Value(__side_top, _side_none_rfid);
+
+				if (ShmSysConfigAndInfo->SysConfig.isQRCode)
+					ChangeDisplay2Value(__side_mid, _side_qr);
+				else
+				{
+					ChangeDisplay2Value(__qr_code_pre, _disappear);
+					ChangeDisplay2Value(__side_mid, _side_none_qr);
+					needReloadQr = true;
+				}
+
+				if (ShmSysConfigAndInfo->SysConfig.isAPP)
+					ChangeDisplay2Value(__side_down, _side_app);
+				else
+					ChangeDisplay2Value(__side_down, _side_none_app);
+			}
+			else
+			{
+				ChangeDisplay2Value(__side_top, _disappear);
+				ChangeDisplay2Value(__side_mid, _disappear);
+				ChangeDisplay2Value(__side_down, _disappear);
+			}
+
+			bool isShowAc = false;
+			if (acgunCount > 0)
+			{
+				if (ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc != NO_DEFINE)
+				{
+					isShowAc = true;
+					ChangeDisplay2Value(__gun_type_index + (2 * 2), _actype_light);
+
+					if (_currentPage == _LCM_CHARGING)
+					{
+						ChangeAcBattMapAndValue(_LCM_CHARGING);
+						if (ac_chargingInfo[0]->RemainChargingDuration >= 0)
+							ChangeRemainTime(ac_chargingInfo[0]->RemainChargingDuration);
+						else
+							ChangeRemainTime(0);
+
+						if (ac_chargingInfo[0]->PresentChargingPower >= 0.1)
+							ChangeChargingPowerValue(ac_chargingInfo[0]->PresentChargingPower);
+						else
+							ChangeChargingPowerValue(0);
+
+						if (ac_chargingInfo[0]->PresentChargedEnergy >= 0.1)
+							ChangeChargingEnergyValue(ac_chargingInfo[0]->PresentChargedEnergy);
+						else
+							ChangeChargingEnergyValue(0);
+
+						if (strcmp((char *)ac_chargingInfo[0]->StartUserId, "") == 0)
+							ChangeDisplay2Value(__stop_method_btn, _stop_charging_btn);
+						else
+							ChangeDisplay2Value(__stop_method_btn, _stop_charging_btn_scan);
+					}
+					else if (_currentPage == _LCM_COMPLETE)
+					{
+						ChangeAcBattMapAndValue(_LCM_COMPLETE);
+						if (ac_chargingInfo[0]->RemainChargingDuration >= 0)
+							ChangeRemainTime(ac_chargingInfo[0]->RemainChargingDuration);
+						else
+							ChangeRemainTime(0);
+
+						if (ac_chargingInfo[0]->PresentChargingPower >= 0.1)
+							ChangeChargingPowerValue(ac_chargingInfo[0]->PresentChargingPower);
+						else
+							ChangeChargingPowerValue(0);
+
+						if (ac_chargingInfo[0]->PresentChargedEnergy >= 0.1)
+						{
+							ChangeChargingEnergyValue(ac_chargingInfo[0]->PresentChargedEnergy);
+
+							if (ShmSysConfigAndInfo->SysConfig.BillingData.isBilling &&
+									ac_chargingInfo[0]->ChargingFee >= 0)
+							{
+								ChangeChargingFeeValue(ac_chargingInfo[0]->ChargingFee);
+							}
+						}
+						else
+						{
+							ChangeChargingEnergyValue(0);
+							ChangeChargingFeeValue(0);
+						}
+
+						if(!ShmSysConfigAndInfo->SysConfig.BillingData.isBilling)
+						{
+							ChangeDisplay2Value(__charging_fee_map, _disappear);
+							ChangeDisplay2Value(__charging_fee_tx, _disappear);
+						}
+						else
+						{
+							ChangeDisplay2Value(__charging_fee_map, _money_map);
+						}
+					}
+				}
+				else
+					ChangeDisplay2Value(__gun_type_index + (2 * 2), _actype_dark);
+			}
+			else
+				ChangeDisplay2Value(__gun_type_index + (2 * 2), _disappear);
+
 			for(byte i = 0; i < _totalCount; i++)
 			{
 				switch(_chargingInfoData[i]->Type)
 				{
 					case _Type_Chademo:
 					{
-						if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == i)
+						if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == i && !isShowAc)
 						{
 							ChangeDisplay2Value(__gun_type_index + (i * 2), _chademo_light);
 						}
@@ -741,19 +961,19 @@ void ProcessPageInfo()
 						break;
 					case _Type_GB:
 					{
-						if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == i)
+						if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == i && !isShowAc)
 						{
-							ChangeDisplay2Value(__gun_type_index + (i * 2), _chademo_light);
+							ChangeDisplay2Value(__gun_type_index + (i * 2), _gbt_light);
 						}
 						else
 						{
-							ChangeDisplay2Value(__gun_type_index + (i * 2), _chademo_dark);
+							ChangeDisplay2Value(__gun_type_index + (i * 2), _gbt_dark);
 						}
 					}
 						break;
 					case _Type_CCS_2:
 					{
-						if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == i)
+						if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == i && !isShowAc)
 						{
 							ChangeDisplay2Value(__gun_type_index + (i * 2), _ccs_light);
 						}
@@ -765,17 +985,25 @@ void ProcessPageInfo()
 						break;
 				}
 
-				if (_currentPage == _LCM_CHARGING)
+				if (_currentPage == _LCM_CHARGING && !isShowAc)
 				{
 					if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == i)
 					{
 						ChangeBattMapAndValue(_LCM_CHARGING, _chargingInfoData[i]->EvBatterySoc);
 						if (_chargingInfoData[i]->RemainChargingDuration >= 0)
 							ChangeRemainTime(_chargingInfoData[i]->RemainChargingDuration);
+						else
+							ChangeRemainTime(0);
+
 						if (_chargingInfoData[i]->PresentChargingPower >= 0)
 							ChangeChargingPowerValue(_chargingInfoData[i]->PresentChargingPower);
-						if (_chargingInfoData[i]->PresentChargedEnergy >= 0)
+						else
+							ChangeChargingPowerValue(0);
+
+						if (_chargingInfoData[i]->PresentChargedEnergy >= 0.1)
 							ChangeChargingEnergyValue(_chargingInfoData[i]->PresentChargedEnergy);
+						else
+							ChangeChargingEnergyValue(0);
 
 						if (strcmp((char *)_chargingInfoData[i]->StartUserId, "") == 0)
 							ChangeDisplay2Value(__stop_method_btn, _stop_charging_btn);
@@ -783,23 +1011,52 @@ void ProcessPageInfo()
 							ChangeDisplay2Value(__stop_method_btn, _stop_charging_btn_scan);
 					}
 				}
-				else if (_currentPage == _LCM_COMPLETE)
+				else if (_currentPage == _LCM_COMPLETE && !isShowAc)
 				{
 					if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == i)
 					{
 						ChangeBattMapAndValue(_LCM_COMPLETE, _chargingInfoData[i]->EvBatterySoc);
 						if (_chargingInfoData[i]->RemainChargingDuration >= 0)
 							ChangeRemainTime(_chargingInfoData[i]->RemainChargingDuration);
+						else
+							ChangeRemainTime(0);
+
 						if (_chargingInfoData[i]->PresentChargingPower >= 0)
 							ChangeChargingPowerValue(_chargingInfoData[i]->PresentChargingPower);
-						if (_chargingInfoData[i]->PresentChargedEnergy >= 0)
+						else
+							ChangeChargingPowerValue(0);
+
+						if (_chargingInfoData[i]->PresentChargedEnergy >= 0.1)
+						{
 							ChangeChargingEnergyValue(_chargingInfoData[i]->PresentChargedEnergy);
+
+							if (ShmSysConfigAndInfo->SysConfig.BillingData.isBilling &&
+								_chargingInfoData[i]->ChargingFee >= 0)
+							{
+								ChangeChargingFeeValue(_chargingInfoData[i]->ChargingFee);
+							}
+						}
+						else
+						{
+							ChangeChargingEnergyValue(0);
+							ChangeChargingFeeValue(0);
+						}
+
+						if(!ShmSysConfigAndInfo->SysConfig.BillingData.isBilling)
+						{
+							ChangeDisplay2Value(__charging_fee_map, _disappear);
+							ChangeDisplay2Value(__charging_fee_tx, _disappear);
+						}
+						else
+						{
+							ChangeDisplay2Value(__charging_fee_map, _money_map);
+						}
 					}
 				}
 			}
 
 			// gun btn and QR code
-			if (_totalCount == 2 && _currentPage != _LCM_PRE_CHARGE)
+			if (_totalCount + acgunCount >= 2 && _currentPage)
 			{
 				byte index = 0;
 				for(index = 0; index < _totalCount; index++)
@@ -814,8 +1071,14 @@ void ProcessPageInfo()
 						_chargingInfoData[index]->SystemStatus == S_RESERVATION ||
 						_chargingInfoData[index]->SystemStatus == S_BOOTING)
 				{
-					// QR Code ³B²z
-					ChangeQrCode_Charge("http://google.com.tw");
+					if (FirstPageChanged() == YES || needReloadQr)
+					{
+						if (ShmSysConfigAndInfo->SysConfig.isQRCode)
+						{
+							needReloadQr = false;
+							ChangeQrCode_Charge("http://google.com.tw");
+						}
+					}
 				}
 			}
 		}
@@ -823,10 +1086,37 @@ void ProcessPageInfo()
 	}
 }
 
-void Initialization()
+void ChangeDisplayMoneyInfo()
 {
-	//strcpy((char *)ShmSysConfigAndInfo->SysInfo.LcmHwRev, moduleName);
+	if (ShmSysConfigAndInfo->SysConfig.BillingData.isBilling)
+	{
+		struct timeb csuTime;
+		struct tm *tmCSU;
+
+		ftime(&csuTime);
+		tmCSU = localtime(&csuTime.time);
 
+		ChangeDisplay2Value(__money_rate_map, _charging_money);
+
+		if (tmCSU->tm_hour <= 23)
+		{
+			ShmSysConfigAndInfo->SysConfig.BillingData.Cur_fee = ShmSysConfigAndInfo->SysConfig.BillingData.Fee[tmCSU->tm_hour];
+			DisplayMoneyRate(ShmSysConfigAndInfo->SysConfig.BillingData.Cur_fee);
+		}
+
+		if (ShmSysConfigAndInfo->SysConfig.BillingData.Currency <= 53)
+			DisplayMoneyCur((byte *)Currency[ShmSysConfigAndInfo->SysConfig.BillingData.Currency]);
+	}
+	else
+	{
+		ChangeDisplay2Value(__money_rate_map, _disappear);
+		ChangeDisplay2Value(__money_by_rate, _disappear);
+		ChangeDisplay2Value(__money_rate, _disappear);
+	}
+}
+
+void Initialization()
+{
 	bool isPass = false;
 	byte count = 5;
 	while(!isPass && count > 0)
@@ -844,6 +1134,25 @@ void Initialization()
 		}
 	}
 
+	isPass = false;
+
+	if (acgunCount > 0)
+	{
+		while(!isPass)
+		{
+			isPass = true;
+			for (byte _index = 0; _index < acgunCount; _index++)
+			{
+				if (!FindAcChargingInfoData(_index, &ac_chargingInfo[0]))
+				{
+					DEBUG_ERROR("EvComm : FindAcChargingInfoData false \n");
+					isPass = false;
+					break;
+				}
+			}
+		}
+	}
+
 	if (count == 0)
 		PRINTF_FUNC("LCM Initialization Gun Fail.............\n");
 }
@@ -866,12 +1175,13 @@ int main(void)
 	_port = CreateCommunicationLcmPort();
 	byte changeWarningPriority = 0;
 	byte curWarningCount = 255;
-	//ChangeBackLight(true);
+	ChangeBackLight(true);
 	_totalCount = ShmSysConfigAndInfo->SysConfig.TotalConnectorCount;
+	acgunCount = ShmSysConfigAndInfo->SysConfig.AcConnectorCount;
 	Initialization();
 
-//	ChangeToOtherPage(_LCM_FIX);
-//	return 0;
+	//ChangeToOtherPage(_LCM_COMPLETE);
+	//return 0;
 
 	while(_port != -1)
 	{
@@ -914,6 +1224,10 @@ int main(void)
 
 			RefreshPageAnimation(_everyPageRollChange);
 
+			if (changeWarningPriority == 0)
+				ChangeDisplayMoneyInfo();
+
+			changeWarningPriority >= 15 ? (_battery_display_ani = true) : (_battery_display_ani = false);
 			changeWarningPriority >= 30 ? changeWarningPriority = 0 : changeWarningPriority++;
 			usleep(100000);
 		}

BIN
EVSE/Projects/DS60-120/Apps/Module_PrimaryComm


+ 18 - 7
EVSE/Projects/DS60-120/Apps/Module_PrimaryComm.c

@@ -106,7 +106,7 @@ void PRINTF_FUNC(char *string, ...)
 	vsnprintf(buffer, sizeof(buffer), string, args);
 	va_end(args);
 
-	if (DEBUG)
+	if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
 		printf("%s \n", buffer);
 	else
 		DEBUG_INFO("%s \n", buffer);
@@ -290,9 +290,13 @@ void SetOutputGpio(byte flash)
 	gpio.AC_Breaker = 0x00;
 
 	if (Config_Gpio_Output(Uart1Fd, Addr.IoExtend, &gpio) == PASS)
-		PRINTF_FUNC("SetOutputGpio sucessfully. %d \n", flash);
+	{
+		//PRINTF_FUNC("SetOutputGpio sucessfully. %d \n", flash);
+	}
 	else
-		PRINTF_FUNC("SetOutputGpio fail. \n");
+	{
+		//PRINTF_FUNC("SetOutputGpio fail. \n");
+	}
 }
 
 void SetRtcData()
@@ -327,9 +331,13 @@ void SetRtcData()
 	rtc.RtcData[13] = '0' + (tmCSU->tm_sec) / 1 % 10;
 
 	if (Config_Rtc_Data(Uart1Fd, Addr.IoExtend, &rtc) == PASS)
-		PRINTF_FUNC("SetRtc sucessfully. \n");
+	{
+		//PRINTF_FUNC("SetRtc sucessfully. \n");
+	}
 	else
-		PRINTF_FUNC("SetRtc fail. \n");
+	{
+		//PRINTF_FUNC("SetRtc fail. \n");
+	}
 }
 
 //================================================
@@ -419,10 +427,13 @@ int main(void)
 		}
 		else
 		{
-			if (flash == NO)
+			if ((GetTimeoutValue(_flash_time) / 1000) > 5000)
 			{
-				flash = YES;
+				if (flash == NO)
+					flash = YES;
+
 				SetOutputGpio(flash);
+				gettimeofday(&_flash_time, NULL);
 			}
 		}
 

BIN
EVSE/Projects/DS60-120/Apps/Module_PsuComm


+ 99 - 53
EVSE/Projects/DS60-120/Apps/Module_PsuComm.c

@@ -78,7 +78,7 @@ void PRINTF_FUNC(char *string, ...)
 	vsnprintf(buffer, sizeof(buffer), string, args);
 	va_end(args);
 
-	if (DEBUG)
+	if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
 		printf("%s \n", buffer);
 	else
 		DEBUG_INFO("%s \n", buffer);
@@ -410,6 +410,8 @@ void GetFwCallback(byte address, short dcSwVer, short pfcSwVer, short hwVer)
 
 	byte group = FindTargetGroup(address);
 
+	sprintf((char *)ShmPsuData->PsuVersion[address].FwPrimaryVersion, "DC %d.%02d", (dcSwVer & 0xFF00) >> 8, dcSwVer & 0xFF);
+	sprintf((char *)ShmPsuData->PsuVersion[address].FwSecondVersion, "PFC %d.%02d", (pfcSwVer & 0xFF00) >> 8, pfcSwVer & 0xFF);
 	if (group == 1)
 		address -= ShmPsuData->PsuGroup[group - 1].GroupPresentPsuQuantity;
 	sprintf((char *)ShmPsuData->PsuGroup[group].PsuModule[address].FwVersion, "DC %d.%02d", (dcSwVer & 0xFF00) >> 8, dcSwVer & 0xFF);
@@ -459,28 +461,43 @@ void GetPresentOutputCallback(byte group, unsigned short outVol, unsigned short
 		{
 			for (byte count = 0; count < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; count++)
 			{
+				float _vol_buf = outputVol;
+				float _cur_buf = outputCur;
+
 				// EVSE - 電壓
-				chargingInfo[count]->PresentChargingVoltage = outputVol;
+				_vol_buf /= 10;
+				chargingInfo[count]->PresentChargingVoltage = _vol_buf;
 				// EVSE - 電流
-				chargingInfo[count]->PresentChargingCurrent = outputCur;
+				_cur_buf /= 10;
+				chargingInfo[count]->PresentChargingCurrent = _cur_buf;
 			}
 		}
 
 		if ((chargingInfo[group]->SystemStatus >= S_PREPARING_FOR_EVSE && chargingInfo[group]->SystemStatus <= S_COMPLETE) ||
 			(chargingInfo[group]->SystemStatus >= S_CCS_PRECHARGE_ST0 && chargingInfo[group]->SystemStatus <= S_CCS_PRECHARGE_ST1))
 		{
+			float _vol_buf = outputVol;
+			float _cur_buf = outputCur;
+
 			// EVSE - 電壓
-			chargingInfo[group]->PresentChargingVoltage = outputVol;
+			_vol_buf /= 10;
+			chargingInfo[group]->PresentChargingVoltage = _vol_buf;
 			// EVSE - 電流
-			chargingInfo[group]->PresentChargingCurrent = outputCur;
+			_cur_buf /= 10;
+			chargingInfo[group]->PresentChargingCurrent = _cur_buf;
 		}
 	}
 	else
 	{
+		float _vol_buf = ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage;
+		float _cur_buf = ShmPsuData->PsuGroup[group].GroupPresentOutputCurrent;
+
 		// EVSE - 電壓
-		chargingInfo[group]->PresentChargingVoltage = ShmPsuData->PsuGroup[group].GroupPresentOutputVoltage;
+		_vol_buf /= 10;
+		chargingInfo[group]->PresentChargingVoltage = _vol_buf;
 		// EVSE - 電流
-		chargingInfo[group]->PresentChargingCurrent = ShmPsuData->PsuGroup[group].GroupPresentOutputCurrent;
+		_cur_buf /= 10;
+		chargingInfo[group]->PresentChargingCurrent = _cur_buf;
 	}
 
 //	PRINTF_FUNC("Gun_%d, PresentChargingCurrent = %f \n", group,
@@ -665,19 +682,22 @@ void Initialization()
 		ShmPsuData->GroupCount = _gunCount;
 }
 
-void CheckSmartChargingStep(bool isCharging)
+void CheckSmartChargingStep(bool isWaitingAver, bool isCharging)
 {
 	if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag == _REASSIGNED_PREPARE_M_TO_A)
 	{
-		if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX)
+		if (isWaitingAver)
 		{
-			PRINTF_FUNC("=============Smart Charging : _REASSIGNED_GET_NEW_CAP============= Step 2 \n");
-			ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_GET_NEW_CAP;
-		}
-		else
-		{
-			PRINTF_FUNC("=============Smart Charging : _REASSIGNED_NONE============= Step 0 \n");
-			ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_NONE;
+			if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX)
+			{
+				PRINTF_FUNC("=============Smart Charging : _REASSIGNED_GET_NEW_CAP============= Step 2 \n");
+				ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_GET_NEW_CAP;
+			}
+			else
+			{
+				PRINTF_FUNC("=============Smart Charging : _REASSIGNED_NONE============= Step 0 \n");
+				ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_NONE;
+			}
 		}
 	}
 	else  if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag ==  _REASSIGNED_PREPARE_A_TO_M)
@@ -700,7 +720,6 @@ void CheckSmartChargingStep(bool isCharging)
 
 int main(void)
 {
-	PRINTF_FUNC("Psu Task boot .... \n");
 	if(InitShareMemory() == FAIL)
 	{
 		#ifdef SystemLogMessage
@@ -862,10 +881,11 @@ int main(void)
 				// sdlu - test
 				int testtime = GetTimeoutValue(_test_time) / 1000;
 
-				bool isCharging = false;
 				// 低 Priority 的指令
 				if (time > 1500)
 				{
+					isCharging = false;
+					isWaitingAver = false;
 					for (byte index = 0; index < ShmPsuData->GroupCount; index++)
 					{
 						// Pooling Status
@@ -881,19 +901,26 @@ int main(void)
 						GetModuleIavailable(index);
 
 						if (chargingInfo[index]->SystemStatus == S_CHARGING)
+						{
 							isCharging = true;
+							if ((chargingInfo[index]->PresentChargingCurrent * 10) >=
+									chargingInfo[index]->EvBatterytargetCurrent - CHK_CUR_RANGE)
+							{
+								isWaitingAver = true;
+							}
+						}
 					}
 
 					gettimeofday(&_cmdSubPriority_time, NULL);
+					CheckSmartChargingStep(isWaitingAver, isCharging);
 				}
 
-				CheckSmartChargingStep(isCharging);
 				for (byte groupIndex = 0; groupIndex < _gunCount; groupIndex++)
 				{
 					GetModuleOutput(groupIndex);
 					// 針對各槍當前狀態,傳送需要回傳的資料指令
 					if (((chargingInfo[groupIndex]->SystemStatus >= S_PREPARING_FOR_EVSE && chargingInfo[groupIndex]->SystemStatus <= S_CHARGING) && chargingInfo[groupIndex]->RelayK1K2Status) ||
-							chargingInfo[groupIndex]->SystemStatus >= S_PREPARING_FOR_EVSE ||
+							(chargingInfo[groupIndex]->SystemStatus >= S_PREPARING_FOR_EVSE && chargingInfo[groupIndex]->SystemStatus <= S_CHARGING && chargingInfo[groupIndex]->Type == _Type_GB) ||
 							(chargingInfo[groupIndex]->SystemStatus >= S_CCS_PRECHARGE_ST0 && chargingInfo[groupIndex]->SystemStatus <= S_CCS_PRECHARGE_ST1))
 					{
 						if (chargingInfo[groupIndex]->EvBatterytargetVoltage > 0 &&
@@ -910,24 +937,30 @@ int main(void)
 							DEBUG_INFO("ev need cur = %f \n", chargingInfo[groupIndex]->EvBatterytargetCurrent);
 						}
 
-						if (chargingInfo[groupIndex]->FireChargingVoltage > 0 &&
-							evseOutVol != (chargingInfo[groupIndex]->FireChargingVoltage / 10))
+						if (time > 1500)
 						{
-							evseOutVol = (chargingInfo[groupIndex]->FireChargingVoltage / 10);
-							PRINTF_FUNC("groupIndex = %d, evse output vol = %f \n", groupIndex,
+							if (chargingInfo[groupIndex]->FireChargingVoltage > 0 &&
+								evseOutVol != (chargingInfo[groupIndex]->FireChargingVoltage / 10))
+							{
+								evseOutVol = (chargingInfo[groupIndex]->FireChargingVoltage / 10);
+								PRINTF_FUNC("groupIndex = %d, evse output vol = %f \n", groupIndex,
 									chargingInfo[groupIndex]->FireChargingVoltage);
-						}
+							}
 
-						if (chargingInfo[groupIndex]->PresentChargingCurrent > 0 &&
-							evseOutCur != chargingInfo[groupIndex]->PresentChargingCurrent)
-						{
-							evseOutCur = chargingInfo[groupIndex]->PresentChargingCurrent;
-							PRINTF_FUNC("groupIndex = %d, evse output cur = %f \n", groupIndex,
-								chargingInfo[groupIndex]->PresentChargingCurrent);
+							if ((chargingInfo[groupIndex]->PresentChargingCurrent * 10) > 0 &&
+								evseOutCur != (chargingInfo[groupIndex]->PresentChargingCurrent * 10))
+							{
+								evseOutCur = (chargingInfo[groupIndex]->PresentChargingCurrent * 10);
+								PRINTF_FUNC("groupIndex = %d, evse output cur = %f \n", groupIndex,
+									(chargingInfo[groupIndex]->PresentChargingCurrent * 10));
+							}
 						}
 
 						if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX)
 						{
+//							PRINTF_FUNC("index = %d, SystemStatus = %d, Ev = %f, curCur = %f \n", groupIndex,
+//									chargingInfo[groupIndex]->SystemStatus, chargingInfo[groupIndex]->EvBatterytargetCurrent,
+//									(chargingInfo[groupIndex]->PresentChargingCurrent * 10));
 							// 智能判斷 Start -----------------------------------------------------------
 							if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag == _REASSIGNED_GET_NEW_CAP)
 							{
@@ -958,13 +991,13 @@ int main(void)
 								if (chargingInfo[groupIndex]->AvailableChargingCurrent < chargingInfo[groupIndex]->EvBatterytargetCurrent)
 								{
 									PRINTF_FUNC("** _REASSIGNED_ADJUST_M_TO_A ** Gun_%d, AvailableChargingCurrent = %f, EvBatterytargetCurrent = %f \n", groupIndex,
-											chargingInfo[groupIndex]->PresentChargingCurrent,
+											(chargingInfo[groupIndex]->PresentChargingCurrent * 10),
 											chargingInfo[groupIndex]->AvailableChargingCurrent);
 									for (byte subIndex = 0; subIndex < ShmPsuData->GroupCount; subIndex++)
 									{
 										if (chargingInfo[subIndex]->SystemStatus == S_REASSIGN)
 										{
-											if (chargingInfo[subIndex]->PresentChargingCurrent <= CHK_CUR_RANGE)
+											if ((chargingInfo[subIndex]->PresentChargingCurrent * 10) <= CHK_CUR_RANGE)
 												isChanged = true;
 											break;
 										}
@@ -972,14 +1005,14 @@ int main(void)
 
 									// 這狀況下輸出端的電流載滿載衝的狀況下,並不會降電流
 									// 所以只能拉載到該槍端的最大輸出能力
-									if (chargingInfo[groupIndex]->PresentChargingCurrent >= chargingInfo[groupIndex]->AvailableChargingCurrent - CHK_CUR_RANGE ||
-											chargingInfo[groupIndex]->PresentChargingCurrent <= CHK_CUR_RANGE)
+									if ((chargingInfo[groupIndex]->PresentChargingCurrent * 10) >= chargingInfo[groupIndex]->AvailableChargingCurrent - CHK_CUR_RANGE ||
+											(chargingInfo[groupIndex]->PresentChargingCurrent * 10) <= CHK_CUR_RANGE)
 									{
 										isChanged = true;
 									}
 								}
-								else if ((chargingInfo[groupIndex]->PresentChargingCurrent >= ShmPsuData->PsuGroup[groupIndex].GroupPresentOutputCurrent - CHK_CUR_RANGE) &&
-										(chargingInfo[groupIndex]->PresentChargingCurrent <= ShmPsuData->PsuGroup[groupIndex].GroupPresentOutputCurrent + CHK_CUR_RANGE))
+								else if (((chargingInfo[groupIndex]->PresentChargingCurrent * 10) >= ShmPsuData->PsuGroup[groupIndex].GroupPresentOutputCurrent - CHK_CUR_RANGE) &&
+										((chargingInfo[groupIndex]->PresentChargingCurrent * 10) <= ShmPsuData->PsuGroup[groupIndex].GroupPresentOutputCurrent + CHK_CUR_RANGE))
 								{
 									isChanged = true;
 								}
@@ -987,7 +1020,7 @@ int main(void)
 								if (isChanged)
 								{
 									PRINTF_FUNC("** _REASSIGNED_ADJUST_M_TO_A ** Gun_%d, PresentChargingCurrent = %f, GroupPresentOutputCurrent = %d \n", groupIndex,
-										chargingInfo[groupIndex]->PresentChargingCurrent,
+										(chargingInfo[groupIndex]->PresentChargingCurrent * 10),
 										ShmPsuData->PsuGroup[groupIndex].GroupPresentOutputCurrent);
 
 									// 輸出端與車端要求電流接近
@@ -998,7 +1031,8 @@ int main(void)
 
 							// 智能判斷 End -----------------------------------------------------------
 							if (testtime > 500 &&
-								(ShmSysConfigAndInfo->SysInfo.ReAssignedFlag >= _REASSIGNED_GET_NEW_CAP && ShmSysConfigAndInfo->SysInfo.ReAssignedFlag <= _REASSIGNED_RELAY_M_TO_A))
+								(ShmSysConfigAndInfo->SysInfo.ReAssignedFlag >= _REASSIGNED_GET_NEW_CAP &&
+										ShmSysConfigAndInfo->SysInfo.ReAssignedFlag <= _REASSIGNED_RELAY_M_TO_A))
 							{
 								PRINTF_FUNC("Gun_%d, AvailableChargingCurrent = %f, AvailableChargingPower = %f \n", groupIndex,
 										chargingInfo[groupIndex]->AvailableChargingCurrent,
@@ -1009,8 +1043,8 @@ int main(void)
 									chargingInfo[groupIndex]->EvBatterytargetCurrent);
 
 								PRINTF_FUNC("Gun_%d OutputVol = %f, OutputCur = %f \n", groupIndex,
-										chargingInfo[groupIndex]->PresentChargingVoltage,
-										chargingInfo[groupIndex]->PresentChargingCurrent);
+										(chargingInfo[groupIndex]->PresentChargingVoltage * 10),
+										(chargingInfo[groupIndex]->PresentChargingCurrent * 10));
 
 								gettimeofday(&_test_time, NULL);
 							}
@@ -1104,12 +1138,12 @@ int main(void)
 											chargingInfo[subIndex]->SystemStatus == S_RESERVATION)
 									{
 										// 各群電壓接近平衡
-										if ((chargingInfo[subIndex]->PresentChargingVoltage < chargingInfo[groupIndex]->PresentChargingVoltage - ZERO_VOLTAGE) ||
-											(chargingInfo[subIndex]->PresentChargingVoltage < chargingInfo[groupIndex]->EvBatterytargetVoltage - CHK_VOL_RANGE))
+										if (((chargingInfo[subIndex]->PresentChargingVoltage * 10) < (chargingInfo[groupIndex]->PresentChargingVoltage * 10) - ZERO_VOLTAGE) ||
+											((chargingInfo[subIndex]->PresentChargingVoltage * 10) < chargingInfo[groupIndex]->EvBatterytargetVoltage - CHK_VOL_RANGE))
 										{
 											PRINTF_FUNC("** _REASSIGNED_ADJUST_A_TO_M ** Gun_%d, PresentChargingVoltage = %f, PresentChargingVoltage_V = %f, EvBatterytargetVoltage = %f \n", subIndex,
-												chargingInfo[subIndex]->PresentChargingVoltage,
-												(chargingInfo[groupIndex]->PresentChargingVoltage - ZERO_VOLTAGE),
+												(chargingInfo[subIndex]->PresentChargingVoltage * 10),
+												((chargingInfo[groupIndex]->PresentChargingVoltage * 10) - ZERO_VOLTAGE),
 												(chargingInfo[groupIndex]->EvBatterytargetVoltage - CHK_VOL_RANGE));
 											balanceVol = false;
 										}
@@ -1149,8 +1183,8 @@ int main(void)
 									chargingInfo[groupIndex]->EvBatterytargetCurrent);
 
 								PRINTF_FUNC("Gun_%d OutputVol = %f, OutputCur = %f \n", groupIndex,
-									chargingInfo[groupIndex]->PresentChargingVoltage,
-									chargingInfo[groupIndex]->PresentChargingCurrent);
+									(chargingInfo[groupIndex]->PresentChargingVoltage * 10),
+									(chargingInfo[groupIndex]->PresentChargingCurrent * 10));
 
 								gettimeofday(&_test_time, NULL);
 							}
@@ -1214,17 +1248,29 @@ int main(void)
 					{
 						if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_MAX)
 						{
-							SwitchPower(SYSTEM_CMD, PSU_POWER_OFF);
-							FlashLed(SYSTEM_CMD, PSU_FLASH_NORMAL);
+							if (!isCharging)
+							{
+								SwitchPower(SYSTEM_CMD, PSU_POWER_OFF);
+								FlashLed(SYSTEM_CMD, PSU_FLASH_NORMAL);
 
-							if (chargingInfo[groupIndex]->SystemStatus == S_TERMINATING)
+								if (chargingInfo[groupIndex]->SystemStatus == S_COMPLETE)
+								{
+									if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag >= _REASSIGNED_PREPARE_M_TO_A &&
+											ShmSysConfigAndInfo->SysInfo.ReAssignedFlag <= _REASSIGNED_RELAY_M_TO_A)
+									{
+										// 代表在切換的過程中,停止充電了
+										if ((chargingInfo[groupIndex]->PresentChargingCurrent * 10) <= STOP_CURRENT)
+											ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_RELAY_M_TO_A;
+									}
+								}
+							}
+							else
 							{
+								// 代表充電的槍依舊在充電,欲進入充電的槍取消充電了
 								if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag >= _REASSIGNED_PREPARE_M_TO_A &&
 										ShmSysConfigAndInfo->SysInfo.ReAssignedFlag <= _REASSIGNED_RELAY_M_TO_A)
 								{
-									// 代表在切換的過程中,停止充電了
-									if (chargingInfo[groupIndex]->PresentChargingCurrent <= STOP_CURRENT)
-										ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_RELAY_M_TO_A;
+									ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_NONE;
 								}
 							}
 						}

+ 3 - 0
EVSE/Projects/DS60-120/Apps/Module_PsuComm.h

@@ -46,5 +46,8 @@ struct timeval _derating_time;
 
 struct timeval _test_time;
 
+bool isCharging = false;
+bool isWaitingAver = false;
+
 int connector_1[] = {0};
 int connector_2[] = {1};

BIN
EVSE/Projects/DS60-120/Apps/ReadCmdline


+ 266 - 77
EVSE/Projects/DS60-120/Apps/ReadCmdline.c

@@ -42,6 +42,8 @@ typedef unsigned char			byte;
 #define PASS				1
 #define FAIL				-1
 #define ARRAY_SIZE(A)		(sizeof(A) / sizeof(A[0]))
+#define	NO_DEFINE			255
+#define DEFAULT_AC_INDEX	2
 
 #define TTY_PATH            "/dev/tty"
 #define STTY_US             "stty raw -echo -F "
@@ -58,7 +60,7 @@ struct RelayModuleData			*ShmRelayModuleData;
 struct PsuData 					*ShmPsuData;
 
 struct ChargingInfoData 		*_chargingData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
-int gunCount = CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY;
+struct ChargingInfoData 		*ac_chargingInfo[AC_QUANTITY];
 
 char *msg = "state : get gun state (index) \n"
 		"card : scanning card (x) : \n"
@@ -100,6 +102,17 @@ bool FindChargingInfoData(byte target, struct ChargingInfoData **chargingData)
 	return false;
 }
 
+bool FindAcChargingInfoData(byte target, struct ChargingInfoData **acChargingData)
+{
+	if (target < AC_QUANTITY)
+	{
+		acChargingData[target] = &ShmSysConfigAndInfo->SysInfo.AcChargingData[target];
+		return true;
+	}
+
+	return false;
+}
+
 int InitShareMemory()
 {
 	int result = PASS;
@@ -202,37 +215,66 @@ int InitShareMemory()
 void RunStatusProc(char *v1, char *v2)
 {
 	int _index = atoi(v1);
-	if (!FindChargingInfoData(_index, &_chargingData[0]))
+	if (_index <= 1)
 	{
-		printf ("FindChargingInfoData error\n");
-		return;
-	}
+		if (!FindChargingInfoData(_index, &_chargingData[0]))
+		{
+			printf ("FindChargingInfoData error\n");
+			return;
+		}
 
-	if (strcmp(v2, "-1") == 0 || strcmp(v2, "") == 0)
-	{
-		// get
-		printf ("index = %x, status = %x (%d)\n", _index, _chargingData[_index]->SystemStatus, _chargingData[_index]->IsAvailable);
-		printf ("SystemTimeoutFlag = %d, PageIndex = %d\n",
-				ShmSysConfigAndInfo->SysInfo.SystemTimeoutFlag, ShmSysConfigAndInfo->SysInfo.PageIndex);
+		if (strcmp(v2, "-1") == 0 || strcmp(v2, "") == 0)
+		{
+			// get
+			printf ("index = %x, status = %x (%d)\n", _index, _chargingData[_index]->SystemStatus, _chargingData[_index]->IsAvailable);
+			printf ("SystemTimeoutFlag = %d, PageIndex = %d\n",
+					ShmSysConfigAndInfo->SysInfo.SystemTimeoutFlag, ShmSysConfigAndInfo->SysInfo.PageIndex);
+		}
+		else
+		{
+			// set
+			_chargingData[_index]->SystemStatus = atoi(v2);
+		}
 	}
 	else
 	{
-		// set
-		_chargingData[_index]->SystemStatus = atoi(v2);
+		if (!FindAcChargingInfoData(0, &ac_chargingInfo[0]))
+		{
+			printf("FindChargingInfoData (AC) false \n");
+		}
+
+		if (strcmp(v2, "-1") == 0 || strcmp(v2, "") == 0)
+		{
+			// get
+			printf ("AC Type, status = %x (%d)\n", ac_chargingInfo[0]->SystemStatus, ac_chargingInfo[0]->IsAvailable);
+		}
+		else
+		{
+			// set
+			ac_chargingInfo[0]->SystemStatus = atoi(v2);
+		}
 	}
 }
 
 void RunCardProc(char *v1, char *v2)
 {
-	if (ShmSysConfigAndInfo->SysInfo.WaitForPlugit)
+	if (strcmp(v1, "-1") == 0 || strcmp(v1, "") == 0)
 	{
-		ShmSysConfigAndInfo->SysInfo.WaitForPlugit = 0x00;
-		printf ("SysInfo.WaitForPlugit = %x \n", ShmSysConfigAndInfo->SysInfo.WaitForPlugit);
+		if (ShmSysConfigAndInfo->SysInfo.WaitForPlugit)
+		{
+			ShmSysConfigAndInfo->SysInfo.WaitForPlugit = 0x00;
+			printf ("SysInfo.WaitForPlugit = %x \n", ShmSysConfigAndInfo->SysInfo.WaitForPlugit);
+		}
+		else
+		{
+			ShmSysConfigAndInfo->SysInfo.WaitForPlugit = 0x01;
+			printf ("SysInfo.WaitForPlugit = %x \n", ShmSysConfigAndInfo->SysInfo.WaitForPlugit);
+		}
 	}
 	else
 	{
-		ShmSysConfigAndInfo->SysInfo.WaitForPlugit = 0x01;
-		printf ("SysInfo.WaitForPlugit = %x \n", ShmSysConfigAndInfo->SysInfo.WaitForPlugit);
+		memcpy((char *)ShmSysConfigAndInfo->SysConfig.UserId, v1, ARRAY_SIZE(v1));
+		printf("StartUserId = %s \n", ShmSysConfigAndInfo->SysConfig.UserId);
 	}
 }
 
@@ -310,6 +352,22 @@ void GetFwVerProc(char *v1)
 	{
 		printf("DC Main Version = %s \n", ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev);
 	}
+	else if (strcmp(v1, "ac") == 0)
+	{
+		if (!FindAcChargingInfoData(0, &ac_chargingInfo[0]))
+		{
+			printf("FindChargingInfoData (AC) false \n");
+		}
+		printf("AC Version = %s \n", ac_chargingInfo[0]->version);
+	}
+}
+
+void CreateOneError(char *v1)
+{
+	int value = atoi(v1);
+
+	ShmStatusCodeData->AlarmCode.AlarmEvents.bits.PrimaryStestFail = value;
+	ShmSysConfigAndInfo->SysConfig.BillingData.isBilling = value;
 }
 
 void FwUpdateFlagProc()
@@ -341,6 +399,10 @@ void SetPowerValue(char *v1, char *v2)
 {
 	int _index = atoi(v1);
 	float _Current = atof(v2);
+	// 盲沖的時候才允許使用~
+	if (_chargingData[_index]->Type != 9)
+		return;
+
 	if (!FindChargingInfoData(_index, &_chargingData[0]))
 	{
 		printf ("FindChargingInfoData error\n");
@@ -358,15 +420,49 @@ void GetSystemInfo()
 			ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
 }
 
+void ChangeGunNum()
+{
+	if (ShmSysConfigAndInfo->SysInfo.CurGunSelected + 1 < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount)
+	{
+		ShmSysConfigAndInfo->SysInfo.CurGunSelected += 1;
+		ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = NO_DEFINE;
+	}
+	else if (ShmSysConfigAndInfo->SysConfig.AcConnectorCount > 0 &&
+			ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc == NO_DEFINE)
+		ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = DEFAULT_AC_INDEX;
+	else
+	{
+		ShmSysConfigAndInfo->SysInfo.CurGunSelected = 0;
+		ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = NO_DEFINE;
+	}
+}
+
 void GetGunSelectedNum(char *v1)
 {
 	if (strcmp(v1, "-1") == 0 || strcmp(v1, "") == 0)
-		printf("connector selected = %d \n", ShmSysConfigAndInfo->SysInfo.CurGunSelected);
+	{
+		if (AC_QUANTITY > 0 &&
+			ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc != NO_DEFINE)
+		{
+			printf("connector select changed = AC \n");
+		}
+		else
+			printf("connector selected = %d \n", ShmSysConfigAndInfo->SysInfo.CurGunSelected);
+	}
 	else
 	{
 		int _index = atoi(v1);
-		ShmSysConfigAndInfo->SysInfo.CurGunSelected = _index;
-		printf("connector select changed = %d \n", _index);
+		if (_index <= 1)
+		{
+			ShmSysConfigAndInfo->SysInfo.CurGunSelected = _index;
+			ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = NO_DEFINE;
+			printf("connector select changed = %d \n", _index);
+		}
+		else if (AC_QUANTITY > 0)
+		{
+			ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = DEFAULT_AC_INDEX;
+			printf("connector select changed = AC \n");
+		}
 	}
 }
 
@@ -385,9 +481,42 @@ void GetFanSpeed()
 	printf("ShmFanModuleData->PresentFan4Speed = %d \n", ShmFanModuleData->PresentFan4Speed);
 }
 
+void SetDebugMode(char *v1)
+{
+	int mode = atoi(v1);
+
+	ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag = mode;
+}
+
+void SetGFDMode(char *v1)
+{
+	int mode = atoi(v1);
+
+	ShmSysConfigAndInfo->SysConfig.AlwaysGfdFlag = mode;
+}
+
+void GetPsuTemp()
+{
+	for (byte index = 0; index < ShmPsuData->GroupCount; index++)
+	{
+		for (byte count = 0; count < ShmPsuData->PsuGroup[index].GroupPresentPsuQuantity; count++)
+		{
+			printf("PSU Temp = %d \n", ShmPsuData->PsuGroup[index].PsuModule[count].ExletTemp);
+		}
+	}
+}
+
+void GetAcInputVol()
+{
+	printf("L1N_L12 = %f, L2N_L23 = %f, L3N_L31 = %f \n",
+			ShmSysConfigAndInfo->SysInfo.InputVoltageR,
+			ShmSysConfigAndInfo->SysInfo.InputVoltageS,
+			ShmSysConfigAndInfo->SysInfo.InputVoltageT);
+}
+
 void GetPsuInformation(char *v1)
 {
-	printf("*************************************************\n");
+	printf("**********************AC Contact needed*************************\n");
 	if(strcmp(v1, "count") == 0)
 	{
 		for (int i = 0; i < 4; i++)
@@ -397,6 +526,12 @@ void GetPsuInformation(char *v1)
 	}
 	else if(strcmp(v1, "ver") == 0)
 	{
+		for (int i = 0; i < ShmPsuData->SystemPresentPsuQuantity; i++)
+		{
+			printf("Psu Index = %d, PriVersion = %s, SecVersion = %s \n",
+					i, ShmPsuData->PsuVersion[i].FwPrimaryVersion, ShmPsuData->PsuVersion[i].FwSecondVersion);
+		}
+
 		for (int i = 0; i < ShmPsuData->GroupCount; i++)
 		{
 			for (int j = 0; j < ShmPsuData->PsuGroup[i].GroupPresentPsuQuantity; j++)
@@ -425,11 +560,31 @@ void GetPsuInformation(char *v1)
 	printf("*************************************************\n");
 }
 
-static int get_char()
+void GetConnectorCapInfo(char *v1)
+{
+	int _GunIndex = atoi(v1);
+
+	if (!FindChargingInfoData(_GunIndex, &_chargingData[0]))
+	{
+		printf ("FindChargingInfoData error\n");
+		return;
+	}
+
+	printf ("Charger Max Current = %d, Max Power = %d \n",
+			ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10,
+			ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10);
+
+	printf ("Index = %d, MaxPow = %f, MaxVol = %f, MaxCur = %f\n",
+			_GunIndex,
+			_chargingData[_GunIndex]->RealMaxPower,
+			_chargingData[_GunIndex]->RealMaxVoltage,
+			_chargingData[_GunIndex]->RealMaxCurrent);
+}
+
+static void get_char(char *word)
 {
     fd_set rfds;
     struct timeval tv;
-    int ch = 0;
 
     FD_ZERO(&rfds);
     FD_SET(0, &rfds);
@@ -439,10 +594,8 @@ static int get_char()
     //if input
     if (select(1, &rfds, NULL, NULL, &tv) > 0)
     {
-        ch = getchar();
+    	fgets(word, 128, stdin);
     }
-
-    return ch;
 }
 
 void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
@@ -451,7 +604,6 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
 	float _Voltage = atof(v2);
 	float _Current = atof(v3);
 	unsigned char PreviousSystemStatus = 0xff;
-	int ch = 0;
 
 	if (!FindChargingInfoData(_GunIndex, &_chargingData[0]))
 	{
@@ -614,8 +766,8 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
     		    }
     		    else if (_chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->GroundFaultStatus > 0x02)
     		    {
-    		             printf ("First Ground Fault check Fail (%d)\n",_chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->GroundFaultStatus);
-    		            _chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus = S_TERMINATING;
+    		        printf ("First Ground Fault check Fail (%d)\n",_chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->GroundFaultStatus);
+    		        _chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus = S_TERMINATING;
     		    }
 
     		}
@@ -637,7 +789,7 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
         	    }
 
     		    //ev task do this
-    		    _chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->PresentChargingPower = ((float)((_chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->PresentChargingVoltage / 10) * (_chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->PresentChargingCurrent / 10)) / 1000);
+    		    _chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->PresentChargingPower = ((float)((_chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->PresentChargingVoltage) * (_chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->PresentChargingCurrent)) / 1000);
 
     		    if (_chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->GroundFaultStatus == 0x02){
     		         printf ("Charging Ground Fault check Fail (%d)\n",_chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->GroundFaultStatus);
@@ -678,7 +830,6 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
         	        PreviousSystemStatus = _chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus;
 
         	        printf ("[UnconditionalCharge - S_COMPLETE]\n");
-
         	    }
         	    sleep(3);
         	    return;
@@ -686,51 +837,60 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
     		break;
     	}
 
-    	/*
-    	//使用 Keyboard input 阻塞方法
-        fgets(InputChar, sizeof(InputChar), stdin);
-
-        if (InputChar[0] == 's' && InputChar[1] == 't' && InputChar[2] == 'o' && InputChar[3] == 'p')
-        {
-           printf ("Precharge Done\n");
-           _chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus = S_TERMINATING;
-
-        }
-        */
-
-        //使用 keybaord input 非阻塞方法
-        ch = get_char();
-        if (ch)
-        {
-            printf("%c \n\r", ch);
-
-            switch (ch)
-            {
-                //Ctrl + C
-                case 3:
-                    //system(STTY_DEF TTY_PATH);
-                        return;
-                //input c or C
-                case 'c':
-                case 'C':
-                    printf("stop \n\r");
-                    //system(STTY_DEF TTY_PATH);
-                    ShmSysConfigAndInfo->SysInfo.StartToChargingFlag = 0x00;
-                    _chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus = S_TERMINATING;
-                    break;
-            }
-        }
+    	char word[128];
+    	char newString[7][10];
+    	int i,j,ctr;
 
-    }
+    	memset(word, 0x00, sizeof(word));
+    	get_char(word);
 
-}
+    	if (strlen(word) == 0)
+    		continue;
 
-void test()
-{
-	printf("L1 = %d, L2 = %d, L3 = %d \n", ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputUVP,
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputUVP,
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputUVP);
-	printf("ExtraErrProcess = %d \n", ShmSysConfigAndInfo->SysWarningInfo.ExtraErrProcess);
+    	j=0; ctr=0;
+    	strcpy(newString[1], "-1");
+    	strcpy(newString[2], "-1");
+    	for (i = 0; i <= (strlen(word)); i++)
+    	{
+    		if (word[i] == ' ' || word[i] == '\0' || word[i] == 10)
+    		{
+    			newString[ctr][j] = '\0';
+    			ctr++;
+    			j = 0;
+    		}
+    		else
+    		{
+    			newString[ctr][j] = word[i];
+    			j++;
+    		}
+    	}
+
+    	if(strcmp(newString[0], "chg") == 0)
+    	{
+    		if (strcmp(newString[1], "-1") == 0 || strcmp(newString[1], "") == 0)
+    		   continue;
+    		if (strcmp(newString[2], "-1") == 0 || strcmp(newString[2], "") == 0)
+    		   continue;
+
+    		float _vol = atof(newString[1]);
+    		float _cur = atof(newString[2]);
+
+    		if (_cur <= 0 || _cur <= 0)
+    		   continue;
+
+    		printf("vol = %f, cur = %f \n", _vol, _cur);
+    		_chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->EvBatterytargetVoltage = _vol * 10;
+    		_chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->EvBatterytargetCurrent = _cur * 10;
+    	}
+    	else if (strcmp(newString[0], "c") == 0)
+    	{
+    		printf("stop \n\r");
+    		ShmSysConfigAndInfo->SysInfo.StartToChargingFlag = 0x00;
+    		_chargingData[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus = S_TERMINATING;
+    	}
+
+    	usleep(100000);
+    }
 }
 
 int main(void)
@@ -848,9 +1008,14 @@ int main(void)
 		}
 		else if(strcmp(newString[0], "select") == 0)
 		{
-			// 取得當前選的槍號
+			// 取得 / 設定 當前選的槍號
 			GetGunSelectedNum(newString[1]);
 		}
+		else if(strcmp(newString[0], "change") == 0)
+		{
+			// 模擬按鈕改變選槍
+			ChangeGunNum();
+		}
 		else if(strcmp(newString[0], "fan") == 0)
 		{
 			// 設定風扇速度
@@ -861,6 +1026,26 @@ int main(void)
 			// 取得風扇速度
 			GetFanSpeed();
 		}
+		else if(strcmp(newString[0], "debug") == 0)
+		{
+			// 設定 debug mode
+			SetDebugMode(newString[1]);
+		}
+		else if (strcmp(newString[0], "gfd") == 0)
+		{
+			// 設定盲沖使用 GFD 功能
+			SetGFDMode(newString[1]);
+		}
+		else if(strcmp(newString[0], "temp") == 0)
+		{
+			// 取得 PSU 溫度
+			GetPsuTemp();
+		}
+		else if(strcmp(newString[0], "acin") == 0)
+		{
+			// 取得三向輸入電壓
+			GetAcInputVol();
+		}
 		else if(strcmp(newString[0], "psu") == 0)
 		{
 			//如果連一個參數都沒有 (此命令不理會) 加上判斷第二參數
@@ -873,9 +1058,13 @@ int main(void)
 			// 取得 PSU 資訊
 			GetPsuInformation(newString[1]);
 		}
-		else if(strcmp(newString[0], "test") == 0)
+		else if (strcmp(newString[0], "cap") == 0)
+		{
+			GetConnectorCapInfo(newString[1]);
+		}
+		else if(strcmp(newString[0], "error") == 0)
 		{
-			test();
+			CreateOneError(newString[1]);
 		}
 		else if(strcmp(newString[0], "strchg") == 0)
 		{

+ 320 - 11
EVSE/Projects/DS60-120/Apps/internalComm.c

@@ -38,8 +38,9 @@
 #define PASS				1
 #define FAIL				-1
 
-struct Address Addr={0x01,0x02,0x03,0xFF};
-struct Command Cmd={0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x81,0x83,0x85,0x86, 0x87,0x8B,0xe0,0xe1,0xe2,0xe3};
+struct Address Addr={0x01,0x02,0x03,0x05,0xFF};
+struct Command Cmd={0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x27,0x28,0x29,0x2C,0x81,0x83,
+		0x85,0x86,0x87,0x88,0x089,0x8A,0x8B,0x8C,0x90,0xe0,0xe1,0xe2,0xe3};
 
 int tranceive(int fd, unsigned char* cmd, unsigned char cmd_len, unsigned char* rx)
 {
@@ -48,7 +49,7 @@ int tranceive(int fd, unsigned char* cmd, unsigned char cmd_len, unsigned char*
 	tcflush(fd,TCIOFLUSH);
 	if(write(fd, cmd, cmd_len) >= cmd_len)
 	{
-		usleep(30000);
+		usleep(15000);
 		len = read(fd, rx, 512);
 	}
 	else
@@ -551,8 +552,7 @@ unsigned char Config_Gpio_Output(unsigned char fd, unsigned char targetAddr, Gpi
 		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
 		   (rx[2] == tx[1]) &&
 		   (rx[1] == tx[2]) &&
-		   (rx[3] == tx[3]) &&
-		   (rx[6] == tx[6]))
+		   (rx[3] == tx[3]))
 		{
 			result = PASS;
 		}
@@ -591,8 +591,7 @@ unsigned char Config_Gfd_Value(unsigned char fd, unsigned char targetAddr, Gfd_c
 		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
 		   (rx[2] == tx[1]) &&
 		   (rx[1] == tx[2]) &&
-		   (rx[3] == tx[3]) &&
-		   (rx[6] == tx[6]))
+		   (rx[3] == tx[3]))
 		{
 			result = PASS;
 		}
@@ -634,8 +633,7 @@ unsigned char Config_Model_Name(unsigned char fd, unsigned char targetAddr, unsi
 		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
 			  (rx[2] == tx[1]) &&
 			  (rx[1] == tx[2]) &&
-			  (rx[3] == tx[3]) &&
-			  (rx[6] == tx[6]))
+			  (rx[3] == tx[3]))
 		{
 			result = PASS;
 		}
@@ -668,8 +666,7 @@ unsigned char Config_Rtc_Data(unsigned char fd, unsigned char targetAddr, Rtc *S
 		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
 				(rx[2] == tx[1]) &&
 				(rx[1] == tx[2]) &&
-				(rx[3] == tx[3]) &&
-				(rx[6] == tx[6]))
+				(rx[3] == tx[3]))
 		{
 			result = PASS;
 		}
@@ -823,3 +820,315 @@ unsigned char Update_Finish(unsigned char fd, unsigned char targetAddr)
 
 	return result;
 }
+
+unsigned char Query_AC_Status(unsigned char fd, unsigned char targetAddr, Ac_Status *Ret_Buf)
+{
+	unsigned char result = FAIL;
+	unsigned char tx[7] = {0xaa, 0x00, targetAddr, Cmd.query_ac_status, 0x00, 0x00, 0x00};
+	unsigned char rx[512];
+	unsigned char chksum = 0x00;
+	unsigned char len = tranceive(fd, tx, sizeof(tx), rx);
+
+	if(len > 6)
+	{
+		if (len < 6+(rx[4] | rx[5]<<8))
+			return result;
+
+		for(int idx = 0;idx<(rx[4] | rx[5]<<8);idx++)
+		{
+			chksum ^= rx[6+idx];
+		}
+
+		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
+				(rx[2] == tx[1]) &&
+				(rx[1] == tx[2]) &&
+				(rx[3] == tx[3]))
+		{
+			Ret_Buf->CpStatus = rx[6];
+			Ret_Buf->CurLimit = (rx[7] | (rx[8] << 8));
+			Ret_Buf->PilotVol_P = (rx[9] | (rx[10] << 8));
+			Ret_Buf->PilotVol_N = (rx[11] | (rx[12] << 8));
+			Ret_Buf->LockStatus = rx[13];
+			Ret_Buf->RelayStatus = rx[14];
+			Ret_Buf->ShutterStatus = rx[15];
+			Ret_Buf->MeterStatus = rx[16];
+			Ret_Buf->PpStatus = rx[17];
+			Ret_Buf->MaxCurrent = rx[18];
+			Ret_Buf->RotateSwitchStatus = rx[19];
+//
+//			Ret_Buf->AC_Connector 		= (rx[6] >> 0) & 0x01;
+//			Ret_Buf->AC_MainBreaker 	= (rx[6] >> 1) & 0x01;
+//			Ret_Buf->SPD 				= (rx[6] >> 2) & 0x01;
+//			Ret_Buf->Door_Open 			= (rx[6] >> 3) & 0x01;
+//			Ret_Buf->GFD[0] 			= (rx[6] >> 4) & 0x01;
+//			Ret_Buf->GFD[1] 			= (rx[6] >> 5) & 0x01;
+//			Ret_Buf->AC_Drop 			= (rx[6] >> 6) & 0x01;
+//
+//			Ret_Buf->Emergency_IO		= (rx[7] >> 0) & 0x01;
+//
+//			Ret_Buf->Button_Emergency_Press	= (rx[8] >> 0) & 0x01;
+//			Ret_Buf->Button_On_Press 	= (rx[8] >> 1) & 0x01;
+//			Ret_Buf->Button_Off_Press	= (rx[8] >> 2) & 0x01;
+//			Ret_Buf->Key_1_Press 		= (rx[8] >> 3) & 0x01;
+//			Ret_Buf->Key_2_Press 		= (rx[8] >> 4) & 0x01;
+//			Ret_Buf->Key_3_Press 		= (rx[8] >> 5) & 0x01;
+//			Ret_Buf->Key_4_Press 		= (rx[8] >> 6) & 0x01;
+
+			result = PASS;
+		}
+	}
+
+	return result;
+}
+
+unsigned char Query_AC_Alarm_Code(unsigned char fd, unsigned char targetAddr, Ac_Alarm_code *Ret_Buf)
+{
+	unsigned char result = FAIL;
+	unsigned char tx[7] = {0xaa, 0x00, targetAddr, Cmd.query_ac_alarm_code, 0x00, 0x00};
+	unsigned char rx[512];
+	unsigned char chksum = 0x00;
+	unsigned char len = tranceive(fd, tx, sizeof(tx), rx);
+
+	if(len > 6)
+	{
+		if (len < 6+(rx[4] | rx[5]<<8))
+			return result;
+
+		for(int idx = 0;idx<(rx[4] | rx[5]<<8);idx++)
+		{
+			chksum ^= rx[6+idx];
+		}
+
+		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
+				(rx[2] == tx[1]) &&
+				(rx[1] == tx[2]) &&
+				(rx[3] == tx[3]))
+		{
+			Ret_Buf->AcAlarmCode = rx[6] + (rx[7] << 8) + (rx[8] << 16) + (rx[9] << 24);
+			result = PASS;
+		}
+	}
+
+	return result;
+}
+
+unsigned char Query_Charging_Energy(unsigned char fd, unsigned char targetAddr, Ac_Charging_energy *Ret_Buf)
+{
+	unsigned char result = FAIL;
+	unsigned char tx[7] = {0xaa, 0x00, targetAddr, Cmd.query_ac_output_energy, 0x00, 0x00,0x00};
+	unsigned char rx[512];
+	unsigned char chksum = 0x00;
+	unsigned char len = tranceive(fd, tx, sizeof(tx), rx);
+
+	if(len > 6)
+	{
+		if (len < 6+(rx[4] | rx[5]<<8))
+			return result;
+
+		for(int idx = 0;idx<(rx[4] | rx[5]<<8);idx++)
+		{
+			chksum ^= rx[6+idx];
+		}
+
+		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
+				(rx[2] == tx[1]) &&
+				(rx[1] == tx[2]) &&
+				(rx[3] == tx[3]))
+		{
+			Ret_Buf->Energy = rx[6] + (rx[7] << 8) + (rx[8] << 16) + (rx[9] << 24);
+			result = PASS;
+		}
+	}
+
+	return result;
+}
+
+unsigned char Query_Charging_Current(unsigned char fd, unsigned char targetAddr, Ac_Charging_current *Ret_Buf)
+{
+	unsigned char result = FAIL;
+	unsigned char tx[7] = {0xaa, 0x00, targetAddr, Cmd.query_ac_output_current, 0x00, 0x00, 0x00};
+	unsigned char rx[512];
+	unsigned char chksum = 0x00;
+	unsigned char len = tranceive(fd, tx, sizeof(tx), rx);
+
+	if(len > 6)
+	{
+		if (len < 6+(rx[4] | rx[5]<<8))
+			return result;
+
+		for(int idx = 0;idx<(rx[4] | rx[5]<<8);idx++)
+		{
+			chksum ^= rx[6+idx];
+		}
+
+		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
+				(rx[2] == tx[1]) &&
+				(rx[1] == tx[2]) &&
+				(rx[3] == tx[3]))
+		{
+			Ret_Buf->OuputCurrentL1 = rx[6] + (rx[7] << 8);
+			Ret_Buf->OuputCurrentL2 = rx[8] + (rx[9] << 8);
+			Ret_Buf->OuputCurrentL3 = rx[10] + (rx[11] << 8);
+			result = PASS;
+		}
+	}
+
+	return result;
+}
+
+unsigned char Config_LED_Status(unsigned char fd, unsigned char targetAddr, Ac_Led_Status *Ret_Buf)
+{
+	unsigned char result = FAIL;
+	unsigned char tx[12] = {0xaa, 0x00, targetAddr, Cmd.config_ac_led_status, 0x05, 0x00, Ret_Buf->ActionMode, (Ret_Buf->AcAlarmCode >> 0) & 0xFF,
+			(Ret_Buf->AcAlarmCode >> 8) & 0xFF, (Ret_Buf->AcAlarmCode >> 16) & 0xFF, (Ret_Buf->AcAlarmCode >> 24) & 0xFF};
+	unsigned char rx[512];
+	unsigned char chksum = 0x00;
+
+	for (int idx = 0; idx < (tx[4] | tx[5] << 8); idx++)
+			chksum ^= tx[6 + idx];
+	tx[11] = chksum;
+
+	if (tranceive(fd, tx, sizeof(tx), rx) > 0)
+	{
+		chksum = 0x00;
+		for (int idx = 0; idx < (rx[4] | rx[5] << 8); idx++)
+		{
+			chksum ^= rx[6 + idx];
+		}
+
+		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
+			(rx[2] == tx[1]) &&
+			(rx[1] == tx[2]) &&
+			(rx[3] == tx[3]))
+		{
+			result = PASS;
+		}
+	}
+
+	return result;
+}
+
+unsigned char Config_Legacy_Req(unsigned char fd, unsigned char targetAddr, unsigned char _switch)
+{
+	unsigned char result = FAIL;
+	unsigned char tx[9] = {0xaa, 0x00, targetAddr, Cmd.config_Legacy_Req, 0x02, 0x00, _switch, 0x00};
+	unsigned char rx[512];
+	unsigned char chksum = 0x00;
+
+	for (int idx = 0; idx < (tx[4] | tx[5] << 8); idx++)
+		chksum ^= tx[6 + idx];
+	tx[8] = chksum;
+
+	if (tranceive(fd, tx, sizeof(tx), rx) > 0)
+	{
+		chksum = 0x00;
+		for (int idx = 0; idx < (rx[4] | rx[5] << 8); idx++)
+		{
+			chksum ^= rx[6 + idx];
+		}
+
+		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
+				(rx[2] == tx[1]) &&
+				(rx[1] == tx[2]) &&
+				(rx[3] == tx[3]))
+		{
+			result = PASS;
+		}
+	}
+
+	return result;
+}
+
+unsigned char Config_Ac_Duty(unsigned char fd, unsigned char targetAddr, unsigned char _value)
+{
+	unsigned char result = FAIL;
+	unsigned char tx[8] = {0xaa, 0x00, targetAddr, Cmd.config_ac_duty, 0x01, 0x00, _value};
+	unsigned char rx[512];
+	unsigned char chksum = 0x00;
+
+	for (int idx = 0; idx < (tx[4] | tx[5] << 8); idx++)
+		chksum ^= tx[6 + idx];
+	tx[7] = chksum;
+
+	if (tranceive(fd, tx, sizeof(tx), rx) > 0)
+	{
+		chksum = 0x00;
+		for (int idx = 0; idx < (rx[4] | rx[5] << 8); idx++)
+		{
+			chksum ^= rx[6 + idx];
+		}
+
+		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
+				(rx[2] == tx[1]) &&
+				(rx[1] == tx[2]) &&
+				(rx[3] == tx[3]))
+		{
+			result = PASS;
+		}
+	}
+
+	return result;
+}
+
+unsigned char Config_CSU_Mode(unsigned char fd, unsigned char targetAddr)
+{
+	unsigned char result = FAIL;
+	unsigned char tx[9] = {0xaa, 0x00, targetAddr, Cmd.config_csu_mode, 0x02, 0x00, 0x01, 0x00};
+	unsigned char rx[512];
+	unsigned char chksum = 0x00;
+
+	for (int idx = 0; idx < (tx[4] | tx[5] << 8); idx++)
+		chksum ^= tx[6 + idx];
+	tx[7] = chksum;
+
+	if (tranceive(fd, tx, sizeof(tx), rx) > 0)
+	{
+		chksum = 0x00;
+		for (int idx = 0; idx < (rx[4] | rx[5] << 8); idx++)
+		{
+			chksum ^= rx[6 + idx];
+		}
+
+		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
+				(rx[2] == tx[1]) &&
+				(rx[1] == tx[2]) &&
+				(rx[3] == tx[3]))
+		{
+			result = PASS;
+		}
+	}
+
+	return result;
+}
+
+unsigned char Config_Reset_MCU(unsigned char fd, unsigned char targetAddr)
+{
+	unsigned char result = FAIL;
+	unsigned char tx[9] = {0xaa, 0x00, targetAddr, Cmd.config_reset_mcu, 0x02, 0x00, 0x01, 0x00};
+	unsigned char rx[512];
+	unsigned char chksum = 0x00;
+
+	for (int idx = 0; idx < (tx[4] | tx[5] << 8); idx++)
+		chksum ^= tx[6 + idx];
+	tx[7] = chksum;
+
+	if (tranceive(fd, tx, sizeof(tx), rx) > 0)
+	{
+		chksum = 0x00;
+		for (int idx = 0; idx < (rx[4] | rx[5] << 8); idx++)
+		{
+			chksum ^= rx[6 + idx];
+		}
+
+		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
+				(rx[2] == tx[1]) &&
+				(rx[1] == tx[2]) &&
+				(rx[3] == tx[3]))
+		{
+			result = PASS;
+		}
+	}
+
+	return result;
+}
+

+ 66 - 0
EVSE/Projects/DS60-120/Apps/internalComm.h

@@ -13,6 +13,7 @@ extern struct Address
 	unsigned char Aux;
 	unsigned char Fan;
 	unsigned char Relay;
+	unsigned char AcPlug;
 	unsigned char Broadcast;
 }Addr;
 
@@ -29,12 +30,25 @@ extern struct Command
 	unsigned char query_Gfd_Adc;				//0x09
 	unsigned char query_Gpio_In;				//0x0a
 
+	unsigned char query_ac_output_current;		//0x27
+	unsigned char query_ac_status;				//0x28
+	unsigned char query_ac_alarm_code;			//0x29
+
+	unsigned char query_ac_output_energy;		//0x2C
+
 	unsigned char config_Fan_Speed;			//0x81
 	unsigned char config_Model_Name;			//0x83
 	unsigned char config_Relay_Output;			//0x85
 	unsigned char config_Gpio_Output;			//0x86
 	unsigned char config_Rtc_Data;				//0x87
+	unsigned char config_ac_led_status;			//0x88
+
+	unsigned char config_ac_duty;			//0x89
+	unsigned char config_Legacy_Req;		//0x8A
 	unsigned char config_Gfd_Value;			//0x8B
+	unsigned char config_reset_mcu;			//0x8C
+
+	unsigned char config_csu_mode;			//0x90
 
 	unsigned char update_Start;				//0xe0
 	unsigned char update_Abort;				//0xe1
@@ -168,6 +182,49 @@ typedef struct RTC
 	unsigned char RtcData[14];
 }Rtc;
 
+typedef struct AC_Status
+{
+	unsigned char 		CpStatus;
+	unsigned short 		CurLimit;
+	short				PilotVol_P;
+	short				PilotVol_N;
+	unsigned char		LockStatus;
+	unsigned char		RelayStatus;
+	unsigned char		ShutterStatus;
+	unsigned char 		MeterStatus;
+	unsigned char 		PpStatus;
+	unsigned char 		MaxCurrent;
+	unsigned char		RotateSwitchStatus;
+}
+Ac_Status;
+
+typedef struct AC_LED_Status
+{
+	unsigned char 		ActionMode;
+	unsigned long		AcAlarmCode;
+}
+Ac_Led_Status;
+
+typedef struct AC_Alarm_Code
+{
+	unsigned int		AcAlarmCode;
+}
+Ac_Alarm_code;
+
+typedef struct AC_Charging_Energy
+{
+	unsigned int		Energy;
+}
+Ac_Charging_energy;
+
+typedef struct AC_Charging_Current
+{
+	unsigned short		OuputCurrentL1;
+	unsigned short		OuputCurrentL2;
+	unsigned short		OuputCurrentL3;
+}
+Ac_Charging_current;
+
 extern unsigned char Query_FW_Ver(unsigned char fd, unsigned char targetAddr, Ver *Ret_Buf);
 extern unsigned char Query_HW_Ver(unsigned char fd, unsigned char targetAddr, Ver *Ret_Buf);
 extern unsigned char Query_Present_InputVoltage(unsigned char fd, unsigned char targetAddr, PresentInputVoltage *Ret_Buf);
@@ -191,4 +248,13 @@ extern unsigned char Update_Abord(unsigned char fd, unsigned char targetAddr);
 extern unsigned char Update_Transfer(unsigned char fd, unsigned char targetAddr, unsigned int startAddr, unsigned char *data, unsigned short int length);
 extern unsigned char Update_Finish(unsigned char fd, unsigned char targetAddr);
 
+extern unsigned char Query_AC_Status(unsigned char fd, unsigned char targetAddr, Ac_Status *Ret_Buf);
+extern unsigned char Query_AC_Alarm_Code(unsigned char fd, unsigned char targetAddr, Ac_Alarm_code *Ret_Buf);
+extern unsigned char Query_Charging_Energy(unsigned char fd, unsigned char targetAddr, Ac_Charging_energy *Ret_Buf);
+extern unsigned char Query_Charging_Current(unsigned char fd, unsigned char targetAddr, Ac_Charging_current *Ret_Buf);
+extern unsigned char Config_LED_Status(unsigned char fd, unsigned char targetAddr, Ac_Led_Status *Ret_Buf);
+extern unsigned char Config_Legacy_Req(unsigned char fd, unsigned char targetAddr, unsigned char _switch);
+extern unsigned char Config_Ac_Duty(unsigned char fd, unsigned char targetAddr, unsigned char _value);
+extern unsigned char Config_CSU_Mode(unsigned char fd, unsigned char targetAddr);
+extern unsigned char Config_Reset_MCU(unsigned char fd, unsigned char targetAddr);
 #endif /* INTERNALCOMM_H_ */

BIN
EVSE/Projects/DS60-120/Apps/main


+ 377 - 105
EVSE/Projects/DS60-120/Apps/main.c

@@ -50,7 +50,11 @@
 #define		UPGRADE_FAN			0x02
 #define		UPGRADE_RB			0x03
 #define		UPGRADE_PRI			0x04
-#define		SYSTEM_MIN_VOL		1500
+#define		UPGRADE_AC			0x05
+#define		SYSTEM_MIN_VOL		150
+
+#define		NO_DEFINE			255
+#define 	DEFAULT_AC_INDEX	2
 
 char 	*valid_Internet[2] 	  = {"8.8.8.8", "180.76.76.76"};
 unsigned char mask_table[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
@@ -75,6 +79,7 @@ int StoreLogMsg_1(const char *fmt, ...);
 unsigned long GetTimeoutValue(struct timeval _sour_time);
 void gpio_set_value(unsigned int gpio, unsigned int value);
 void PRINTF_FUNC(char *string, ...);
+void ChangeGunSelectByIndex(byte sel);
 
 #define DEBUG_INFO_MSG(format, args...) StoreLogMsg_1("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
 #define DEBUG_WARN_MSG(format, args...) StoreLogMsg_1("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
@@ -92,24 +97,28 @@ struct RelayModuleData			*ShmRelayModuleData;
 struct OCPP16Data				*ShmOCPP16Data;
 
 struct ChargingInfoData			*chargingInfo[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
+struct ChargingInfoData			*ac_chargingInfo[AC_QUANTITY];
 struct timeb 					startChargingTime[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
 struct timeb 					endChargingTime[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
 
 // for initial index to check EV board type is correct
 byte _gunIndex = 0;
+byte _acgunIndex = 0;
 byte _chademoIndex = 0;
 byte _ccsIndex = 0;
 byte _gb_Index = 0;
+byte _ac_Index = 0;
 byte bd0_1_status = 0;
 byte bd0_2_status = 0;
 byte bd1_1_status = 0;
 byte bd1_2_status = 0;
 
 bool isCardScan = false;
+bool isModelNameMatch = true;
 
 int rfidFd = -1;
 char* rfidPortName = "/dev/ttyS2";
-char* fwVersion = "D0.02.00.00.07.00";
+char* fwVersion = "D0.10.00.0000.00";
 
 //================================================
 // initial can-bus
@@ -171,7 +180,7 @@ int InitComPort(byte target)
 
 	if(target == UPGRADE_PRI)
 		fd = open(_priPortName, O_RDWR);
-	else if (target == UPGRADE_FAN ||  target == UPGRADE_RB)
+	else if (target == UPGRADE_FAN ||  target == UPGRADE_RB || target == UPGRADE_AC)
 		fd = open(_485PortName, O_RDWR);
 
 	if(fd<=0)
@@ -296,7 +305,7 @@ void PRINTF_FUNC(char *string, ...)
 	vsnprintf(buffer, sizeof(buffer), string, args);
 	va_end(args);
 
-	if (DEBUG)
+	if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
 		printf("%s \n", buffer);
 	else
 		DEBUG_INFO_MSG("%s \n", buffer);
@@ -1024,12 +1033,17 @@ void GetFirmwareVersion()
 			ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev[9] = '0';
 			break;
 	}
-
 	// Get rating power from model name
-	memcpy(&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev[10], &ShmSysConfigAndInfo->SysConfig.ModelName[4], 0x01);
+	memcpy(&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev[10], &ShmSysConfigAndInfo->SysConfig.ModelName[4], 0x03);
 
-	// Get rating power from model name
-	memcpy(&ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev[12], &ShmSysConfigAndInfo->SysConfig.ModelName[5], 0x02);
+	// Get IEC or UL
+	char _buf[3] = {0};
+	memcpy(_buf, &ShmSysConfigAndInfo->SysConfig.ModelName[2], 2);
+
+	if (strcmp(_buf, "YE") == EQUAL)
+		ShmSysConfigAndInfo->SysInfo.ChargerType = _CHARGER_TYPE_IEC;
+	else if (strcmp(_buf, "WU") == EQUAL)
+		ShmSysConfigAndInfo->SysInfo.ChargerType = _CHARGER_TYPE_UL;
 }
 
 void InitialShareMemoryInfo()
@@ -1120,22 +1134,29 @@ void InitialShareMemoryInfo()
 	char EvsePower[2];
 
 	EvsePower[2] = '\0';
+	unsigned short buf_pow = 0;
 	if (strlen((char *) ShmSysConfigAndInfo->SysConfig.ModelName) >= 6)
 	{
 		strncpy(EvsePower, (char *)(ShmSysConfigAndInfo->SysConfig.ModelName + 4), 2);
 		if (strcmp(EvsePower, "15") == EQUAL)
-			ShmSysConfigAndInfo->SysConfig.MaxChargingPower = 150;
+			buf_pow = 150;
 		else if (strcmp(EvsePower, "30") == EQUAL)
-			ShmSysConfigAndInfo->SysConfig.MaxChargingPower = 30;
+			buf_pow = 30;
 		else if (strcmp(EvsePower, "60") == EQUAL)
-			ShmSysConfigAndInfo->SysConfig.MaxChargingPower = 60;
+			buf_pow = 60;
 		else if (strcmp(EvsePower, "18") == EQUAL)
-			ShmSysConfigAndInfo->SysConfig.MaxChargingPower = 180;
+			buf_pow = 180;
 		else if (strcmp(EvsePower, "36") == EQUAL)
-			ShmSysConfigAndInfo->SysConfig.MaxChargingPower = 360;
+			buf_pow = 360;
+
+		if(ShmSysConfigAndInfo->SysConfig.MaxChargingPower == 0 ||
+				ShmSysConfigAndInfo->SysConfig.MaxChargingPower > buf_pow)
+			ShmSysConfigAndInfo->SysConfig.MaxChargingPower = buf_pow;
 
 		ShmSysConfigAndInfo->SysConfig.RatingCurrent = (ShmSysConfigAndInfo->SysConfig.MaxChargingPower / 30) * 100;
 	}
+	ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag = NO;
+	ShmSysConfigAndInfo->SysConfig.AlwaysGfdFlag = NO;
 }
 
 int Initialization()
@@ -1173,10 +1194,17 @@ int Initialization()
 			}
 		}
 
-
 		strcpy((char *)ShmOCPP16Data->StatusNotification[count].ErrorCode, "NoError");
 	}
 
+	for (byte count = 0; count < ShmSysConfigAndInfo->SysConfig.AcConnectorCount; count++)
+	{
+		if (ac_chargingInfo[count]->Type == _Type_AC)
+		{
+			ac_chargingInfo[count]->SelfTest_Comp = NO;
+		}
+	}
+
 	PRINTF_FUNC("Initialization OK \n");
 	return PASS;
 }
@@ -1229,6 +1257,12 @@ void DisplaySelfTestFailReason()
 			}
 		}
 	}
+	for (byte index = 0; index < ShmSysConfigAndInfo->SysConfig.AcConnectorCount; index++)
+	{
+		// 先借 GBT 顯示
+		if (ac_chargingInfo[index]->SelfTest_Comp == NO)
+		{ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.AcConnectorStestFail = YES; }
+	}
 
 	if (ShmSysConfigAndInfo->SysInfo.AcContactorStatus == NO)
 	{
@@ -1342,6 +1376,22 @@ void SelfTestRun()
 								}
 							}
 						}
+
+						for (byte index = 0; index < ShmSysConfigAndInfo->SysConfig.AcConnectorCount; index++)
+						{
+							if (ac_chargingInfo[index]->Type == _Type_AC)
+							{
+								if (strlen((char *)ac_chargingInfo[index]->version) != 0 ||
+										ac_chargingInfo[index]->version[0] != '\0')
+								{
+									ac_chargingInfo[index]->SelfTest_Comp = YES;
+								}
+								else
+								{
+									evInitFlag = NO;
+								}
+							}
+						}
 					}
 
 					if (ShmFanModuleData->SelfTest_Comp &&
@@ -1402,6 +1452,7 @@ int SpawnTask()
 	system("/root/Module_LcmControl &");
 	system("/root/Module_InternalComm &");
 	system("/root/Module_PsuComm &");
+	system("/root/Module_ProduceUtils &");
 
 	if(strcmp((char *)ShmSysConfigAndInfo->SysConfig.OcppServerURL, "") != EQUAL &&
 		strcmp((char *)ShmSysConfigAndInfo->SysConfig.ChargeBoxId, "") != EQUAL)
@@ -1539,7 +1590,7 @@ bool isEvStopCharging_chademo(byte gunIndex)
 	if (isEvGunLocked_chademo(gunIndex) == NO)
 	{
 		// 無鎖槍 = 停止
-		PRINTF_FUNC("gun locked none. \n");
+		PRINTF_FUNC("gun locked none (%d) \n", gunIndex);
 		return YES;
 	}
 
@@ -1621,12 +1672,21 @@ bool isEvStopCharging_ccs(byte gunIndex)
 void DisplayChargingInfo()
 {
 	PRINTF_FUNC("*********** DisplayChargingInfo *********** \n");
-	for (byte i = ShmSysConfigAndInfo->SysConfig.TotalConnectorCount - 1; i >= 0; i--)
+	if (ShmSysConfigAndInfo->SysConfig.AcConnectorCount > 0 &&
+		ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc == NO_DEFINE &&
+		ac_chargingInfo[0]->SystemStatus >= S_PREPARNING && ac_chargingInfo[0]->SystemStatus <= S_COMPLETE)
 	{
-		if (chargingInfo[i]->SystemStatus != S_IDLE)
+		ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = DEFAULT_AC_INDEX;
+	}
+	else
+	{
+		for (byte i = ShmSysConfigAndInfo->SysConfig.TotalConnectorCount - 1; i >= 0; i--)
 		{
-			ShmSysConfigAndInfo->SysInfo.CurGunSelected = i;
-			break;
+			if (chargingInfo[i]->SystemStatus != S_IDLE)
+			{
+				ChangeGunSelectByIndex(i);
+				break;
+			}
 		}
 	}
 	usleep(50000);
@@ -1800,6 +1860,10 @@ void RecordAlarmCode(char *code)
 	if (strcmp(code, "012288") == 0) ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CcsOutputUVPFail = YES;
 	if (strcmp(code, "012289") == 0) ShmStatusCodeData->AlarmCode.AlarmEvents.bits.ChademoOutputUVPFail = YES;
 	if (strcmp(code, "012290") == 0) ShmStatusCodeData->AlarmCode.AlarmEvents.bits.GbtOutputUVPFail = YES;
+
+	if (strcmp(code, "012296") == 0) ShmStatusCodeData->AlarmCode.AlarmEvents.bits.ChademoGroundWarning = YES;
+	if (strcmp(code, "012297") == 0) ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CcsGroundfaultWarning = YES;
+	if (strcmp(code, "012298") == 0) ShmStatusCodeData->AlarmCode.AlarmEvents.bits.GbGroundfaultWarning = YES;
 }
 
 void ReleaseAlarmCode(byte gunIndex)
@@ -1809,21 +1873,30 @@ void ReleaseAlarmCode(byte gunIndex)
 		ShmStatusCodeData->AlarmCode.AlarmEvents.bits.ChademoGfdTrip = NO;
 		ShmStatusCodeData->AlarmCode.AlarmEvents.bits.ChademoOutputUVPFail = NO;
 		ShmStatusCodeData->FaultCode.FaultEvents.bits.ChademoOutputRelayWelding = NO;
+		ShmStatusCodeData->AlarmCode.AlarmEvents.bits.ChademoGroundWarning = NO;
 	}
 	else if (chargingInfo[gunIndex]->Type == _Type_GB)
 	{
 		ShmStatusCodeData->AlarmCode.AlarmEvents.bits.GbGfdTrip = NO;
 		ShmStatusCodeData->AlarmCode.AlarmEvents.bits.GbtOutputUVPFail = NO;
 		ShmStatusCodeData->FaultCode.FaultEvents.bits.GbOutputRelayWelding = NO;
+		ShmStatusCodeData->AlarmCode.AlarmEvents.bits.GbGroundfaultWarning = NO;
 	}
 	else if (chargingInfo[gunIndex]->Type == _Type_CCS_2)
 	{
 		ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CcsGfdTrip = NO;
 		ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CcsOutputUVPFail = NO;
 		ShmStatusCodeData->FaultCode.FaultEvents.bits.CcsOutputRelayWelding = NO;
+		ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CcsGroundfaultWarning = NO;
 	}
 }
 
+void CleanAlarmCodeByString(char *code)
+{
+	if (strcmp(code, "012296") == 0) ShmStatusCodeData->AlarmCode.AlarmEvents.bits.ChademoGroundWarning = NO;
+	if (strcmp(code, "012297") == 0) ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CcsGroundfaultWarning = NO;
+	if (strcmp(code, "012298") == 0) ShmStatusCodeData->AlarmCode.AlarmEvents.bits.GbGroundfaultWarning = NO;
+}
 //===============================================
 // EmergencyStop and Charging Stop
 //===============================================
@@ -1832,6 +1905,11 @@ void ChargingTerminalProcess(byte gunIndex)
 	setChargerMode(gunIndex, MODE_TERMINATING);
 }
 
+void AcChargingTerminalProcess()
+{
+	ac_chargingInfo[0]->SystemStatus = MODE_TERMINATING;
+}
+
 void StopChargingProcessByString(byte level)
 {
 	if (level > ShmSysConfigAndInfo->SysWarningInfo.Level)
@@ -1980,12 +2058,45 @@ void ChkPrimaryStatus()
 		{
 			leftBtnPush = true;
 			PRINTF_FUNC("left btn down............................... \n");
-			if (ShmSysConfigAndInfo->SysInfo.CurGunSelected + 1 < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount)
-				ShmSysConfigAndInfo->SysInfo.CurGunSelected += 1;
-			else
-				ShmSysConfigAndInfo->SysInfo.CurGunSelected = 0;
+			switch(chargingInfo[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus)
+			{
+				case S_IDLE:
+				{
+					if(isDetectPlugin())
+					{
+						_DetectPlugInTimeout();
+						StopSystemTimeoutDet();
+					}
+				}
+					break;
+				case S_PREPARNING:
+				case S_PREPARING_FOR_EV:
+				case S_PREPARING_FOR_EVSE:
+				case S_CCS_PRECHARGE_ST0:
+				case S_CCS_PRECHARGE_ST1:
+				{
+					// 取消充電
+					ChargingTerminalProcess(ShmSysConfigAndInfo->SysInfo.CurGunSelected);
+				}
+					break;
+				case S_CHARGING:
+				{
+					if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE)
+					{
+						// 停止充電
+						ChargingTerminalProcess(ShmSysConfigAndInfo->SysInfo.CurGunSelected);
+					}
+				}
+					break;
+				case S_COMPLETE:
+				{
+					// 回 IDLE
+					//PRINTF_FUNC("right btn down.................S_COMPLETE \n");
+					//chargingInfo[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus = S_IDLE;
+				}
+					break;
+			}
 		}
-		// 左邊的選槍按鈕,只有在雙槍都在充電時候才有用 : 30KW 以下該按鈕無作用
 	}
 	else if (ShmPrimaryMcuData->InputDet.bits.Button1 == BTN_RELEASE)
 	{
@@ -2002,43 +2113,18 @@ void ChkPrimaryStatus()
 		{
 			rightBtnPush = true;
 			PRINTF_FUNC("right btn down............................... %d \n", ShmSysConfigAndInfo->SysInfo.CurGunSelected);
-			switch(chargingInfo[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus)
-			{
-			case S_IDLE:
-			{
-				if(isDetectPlugin())
-				{
-					_DetectPlugInTimeout();
-					StopSystemTimeoutDet();
-				}
-			}
-				break;
-			case S_PREPARNING:
-			case S_PREPARING_FOR_EV:
-			case S_PREPARING_FOR_EVSE:
-			case S_CCS_PRECHARGE_ST0:
-			case S_CCS_PRECHARGE_ST1:
-			{
-				// 取消充電
-				ChargingTerminalProcess(ShmSysConfigAndInfo->SysInfo.CurGunSelected);
-			}
-				break;
-			case S_CHARGING:
+			if (ShmSysConfigAndInfo->SysInfo.CurGunSelected + 1 < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount)
 			{
-				if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == _SYS_AUTHORIZE_FREE)
-				{
-					// 停止充電
-					ChargingTerminalProcess(ShmSysConfigAndInfo->SysInfo.CurGunSelected);
-				}
+				ShmSysConfigAndInfo->SysInfo.CurGunSelected++;
+				ChangeGunSelectByIndex(ShmSysConfigAndInfo->SysInfo.CurGunSelected);
 			}
-				break;
-			case S_COMPLETE:
+			else if (ShmSysConfigAndInfo->SysConfig.AcConnectorCount > 0 &&
+					ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc == NO_DEFINE)
+				ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = DEFAULT_AC_INDEX;
+			else
 			{
-				// 回 IDLE
-				//PRINTF_FUNC("right btn down.................S_COMPLETE \n");
-				//chargingInfo[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus = S_IDLE;
-			}
-				break;
+				ShmSysConfigAndInfo->SysInfo.CurGunSelected = 0;
+				ChangeGunSelectByIndex(ShmSysConfigAndInfo->SysInfo.CurGunSelected);
 			}
 		}
 	}
@@ -2102,6 +2188,25 @@ void CheckErrorOccurStatus(byte index)
 			}
 		}
 	}
+
+	if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputOVP == YES ||
+			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputOVP == YES ||
+			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputOVP == YES)
+	{
+		if (ShmSysConfigAndInfo->SysWarningInfo.ExtraErrProcess == _EXTRA_ERR_PROCESS_NONE)
+		{
+			ShmSysConfigAndInfo->SysWarningInfo.ExtraErrProcess = _EXTRA_ERR_PROCESS_INOVP;
+			StopChargingProcessByString(2);
+		}
+	}
+	else
+	{
+		if (ShmSysConfigAndInfo->SysWarningInfo.ExtraErrProcess == _EXTRA_ERR_PROCESS_INOVP)
+		{
+			ShmSysConfigAndInfo->SysWarningInfo.ExtraErrProcess = _EXTRA_ERR_PROCESS_NONE;
+			ReleaseChargingProcessByString(2);
+		}
+	}
 }
 
 //===============================================
@@ -2302,7 +2407,6 @@ void UserScanFunction()
 		// 2. 停止充電
 		for (byte i = 0; i < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; i++)
 		{
-			// 二擇一
 			if (ShmSysConfigAndInfo->SysInfo.PageIndex == _LCM_FIX ||
 					(chargingInfo[i]->SystemStatus >= S_AUTHORIZING && chargingInfo[i]->SystemStatus <= S_PREPARNING) ||
 					(chargingInfo[i]->SystemStatus >= S_TERMINATING && chargingInfo[i]->SystemStatus < S_COMPLETE))
@@ -2314,16 +2418,39 @@ void UserScanFunction()
 			{
 				stopReq = i;
 			}
-			else if (chargingInfo[i]->SystemStatus == S_IDLE && chargingInfo[i]->IsAvailable == YES)
+			if ((chargingInfo[i]->SystemStatus == S_IDLE && chargingInfo[i]->IsAvailable) == YES ||
+					(_acgunIndex > 0 && ac_chargingInfo[0]->SystemStatus == S_IDLE && ac_chargingInfo[0]->IsAvailable))
 			{
 				idleReq = true;
 			}
 		}
 
+		if (_acgunIndex > 0 && ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc == DEFAULT_AC_INDEX &&
+				ac_chargingInfo[0]->SystemStatus == S_CHARGING)
+		{
+			stopReq = DEFAULT_AC_INDEX;
+		}
+
 		if (strlen((char *)ShmSysConfigAndInfo->SysConfig.UserId) > 0)
 		{
-			if (stopReq < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount &&
-					chargingInfo[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus == S_CHARGING)
+			if (_acgunIndex > 0 && stopReq == DEFAULT_AC_INDEX && ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc == DEFAULT_AC_INDEX)
+			{
+				char value[32];
+
+				PRINTF_FUNC("ac stop charging \n");
+				PRINTF_FUNC("index = %d, card number = %s, UserId = %s \n", ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc,
+						ac_chargingInfo[0]->StartUserId, ShmSysConfigAndInfo->SysConfig.UserId);
+				memcpy(value, (unsigned char *)ac_chargingInfo[0]->StartUserId,
+					ARRAY_SIZE(ac_chargingInfo[0]->StartUserId));
+				if (strcmp((char *)ShmSysConfigAndInfo->SysConfig.UserId, value) == EQUAL)
+				{
+					AcChargingTerminalProcess();
+				}
+				strcpy((char *)ShmSysConfigAndInfo->SysConfig.UserId, "");
+			}
+			else if (stopReq < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount &&
+					chargingInfo[ShmSysConfigAndInfo->SysInfo.CurGunSelected]->SystemStatus == S_CHARGING &&
+					(_acgunIndex > 0 && ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc == NO_DEFINE))
 			{
 				char value[32];
 
@@ -2381,8 +2508,8 @@ unsigned char isModeChange(unsigned char gun_index)
 
 void ScannerCardProcess()
 {
-	if (!isDetectPlugin() && !isCardScan && ShmSysConfigAndInfo->SysWarningInfo.Level == 0 &&
-			ShmSysConfigAndInfo->SysConfig.AuthorisationMode == _SYS_AUTHORIZE_OCPP)
+	if (!isDetectPlugin() && !isCardScan && ShmSysConfigAndInfo->SysWarningInfo.Level != 2 &&
+			ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_ENABLE)
 	{
 		isCardScan = true;
 		// 處理刷卡及驗證卡號的動作
@@ -2444,8 +2571,10 @@ void ScannerCardProcess()
 		isCardScan = false;
 }
 
-void AddGunInfoByConnector(byte typeValue, byte slots)
+bool AddGunInfoByConnector(byte typeValue, byte slots)
 {
+	bool result = true;
+
 	switch (typeValue)
 	{
 		case '0': // none
@@ -2457,6 +2586,20 @@ void AddGunInfoByConnector(byte typeValue, byte slots)
 		case '3': // IEC 62196-2 Type 2 Plug
 			break;
 		case '4': // IEC 62196-2 Type 2 Socket
+			if (AC_QUANTITY > _ac_Index)
+			{
+				ac_chargingInfo[_acgunIndex] = &ShmSysConfigAndInfo->SysInfo.AcChargingData[_ac_Index];
+
+				// AC 固定 index
+				ac_chargingInfo[_acgunIndex]->Index = 1;
+				ac_chargingInfo[_acgunIndex]->SystemStatus = S_BOOTING;
+				ac_chargingInfo[_acgunIndex]->Type = _Type_AC;
+				ac_chargingInfo[_acgunIndex]->IsAvailable = YES;
+				_ac_Index++;
+				_acgunIndex++;
+			}
+			else
+				result = false;
 			break;
 		case '5': // GB/T AC Plug
 			break;
@@ -2477,6 +2620,8 @@ void AddGunInfoByConnector(byte typeValue, byte slots)
 				_chademoIndex++;
 				_gunIndex++;
 			}
+			else
+				result = false;
 		}
 			break;
 		case 'U': // CCS1 combo
@@ -2497,6 +2642,8 @@ void AddGunInfoByConnector(byte typeValue, byte slots)
 				_ccsIndex++;
 				_gunIndex++;
 			}
+			else
+				result = false;
 		}
 			break;
 		case 'G': // GBT DC
@@ -2505,7 +2652,7 @@ void AddGunInfoByConnector(byte typeValue, byte slots)
 			{
 				chargingInfo[_gunIndex] = &ShmSysConfigAndInfo->SysInfo.GbChargingData[_gb_Index];
 
-				chargingInfo[_gunIndex]->Index =	_gunIndex;
+				chargingInfo[_gunIndex]->Index = _gunIndex;
 				chargingInfo[_gunIndex]->slotsIndex = slots;
 				chargingInfo[_gunIndex]->SystemStatus = S_BOOTING;
 				chargingInfo[_gunIndex]->Type = _Type_GB;
@@ -2514,11 +2661,14 @@ void AddGunInfoByConnector(byte typeValue, byte slots)
 				_gb_Index++;
 				_gunIndex++;
 			}
+			else
+				result = false;
 		}
 			break;
 		case 'D': // GBT DC x 2
 			break;
 	}
+	return result;
 }
 
 bool CheckConnectorTypeStatus()
@@ -2532,13 +2682,21 @@ bool CheckConnectorTypeStatus()
 		byte slots = 1;
 		for (byte typeIndex = 7; typeIndex <= 9; typeIndex++)
 		{
-			AddGunInfoByConnector(ShmSysConfigAndInfo->SysConfig.ModelName[typeIndex], slots);
+			if(!AddGunInfoByConnector(ShmSysConfigAndInfo->SysConfig.ModelName[typeIndex], slots))
+			{
+				return false;
+			}
 			slots++;
 		}
 
 		ShmSysConfigAndInfo->SysConfig.TotalConnectorCount = _gunIndex;
-		PRINTF_FUNC("_gunCount = %d \n", ShmSysConfigAndInfo->SysConfig.TotalConnectorCount);
-		if (ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 0)
+		ShmSysConfigAndInfo->SysConfig.AcConnectorCount = _acgunIndex;
+		PRINTF_FUNC("DC _gunCount = %d, AC _gunCount = %d \n",
+				ShmSysConfigAndInfo->SysConfig.TotalConnectorCount,
+				ShmSysConfigAndInfo->SysConfig.AcConnectorCount);
+
+		if (ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 0 &&
+				ShmSysConfigAndInfo->SysConfig.AcConnectorCount == 0)
 			result = false;
 
 		// 偵測槍屬於哪個 slot : 可知道插在板上的Slot 0 或 1 是 Chademo 還是 CCS
@@ -2688,6 +2846,7 @@ char CheckUpdateProcess()
 			    	case 0x10000006:
 			    	case 0x1000000D:
 			    	case 0x1000000E:
+			    	case 0x20000002:
 			    	{
 			    		// CSU_PRIMARY_CONTROLLER : 0x10000006
 			    		byte target = 0x00;
@@ -2698,6 +2857,8 @@ char CheckUpdateProcess()
 			    			target = UPGRADE_RB;
 			    		else if (Type == 0x1000000E)
 			    			target = UPGRADE_FAN;
+			    		else if (Type == 0x20000002)
+			    			target = UPGRADE_AC;
 
 			    		int fd = InitComPort(target);
 
@@ -2764,11 +2925,12 @@ void CreateRfidFork()
 		{
 			// 刷卡判斷
 			RFID rfid;
-			if (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == _OFFLINE_POLICY_NO_CHARGING)
+			if (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == _OFFLINE_POLICY_NO_CHARGING ||
+					!ShmSysConfigAndInfo->SysConfig.isRFID)
 			{}
 			else if(getRequestCardSN(rfidFd, 0, &rfid))
 			{
-				PRINTF_FUNC("Get Card.. \n");
+				PRINTF_FUNC("Get Card..-%s- \n", ShmSysConfigAndInfo->SysConfig.UserId);
 				if (strlen((char *)ShmSysConfigAndInfo->SysConfig.UserId) == 0)
 				{
 					if (ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian == RFID_ENDIAN_LITTLE)
@@ -3264,7 +3426,7 @@ bool CheckBackendChargingTimeout(byte gunIndex)
 {
 	bool result = false;
 
-	if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == _SYS_AUTHORIZE_OCPP)
+	if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_ENABLE)
 	{
 		if (ShmSysConfigAndInfo->SysConfig.MaxChargingDuration > 0)
 		{
@@ -3272,7 +3434,7 @@ bool CheckBackendChargingTimeout(byte gunIndex)
 				result = true;
 		}
 	}
-	else if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == _SYS_AUTHORIZE_FREE)
+	else if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE)
 	{
 		// 隨插即充電的要看 offline
 		if (ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeDuration > 0)
@@ -3289,7 +3451,7 @@ bool CheckBackendChargingEnergy(byte gunIndex)
 {
 	bool result = false;
 
-	if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == _SYS_AUTHORIZE_OCPP)
+	if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_ENABLE)
 	{
 		if (ShmSysConfigAndInfo->SysConfig.MaxChargingEnergy > 0)
 		{
@@ -3297,7 +3459,7 @@ bool CheckBackendChargingEnergy(byte gunIndex)
 				result = true;
 		}
 	}
-	else if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == _SYS_AUTHORIZE_FREE)
+	else if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE)
 	{
 		// 隨插即充電的要看 offline
 		if (ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy > 0)
@@ -3408,6 +3570,12 @@ void zipLogFiles()
 	closedir(pDir);
 }
 
+void ChangeGunSelectByIndex(byte sel)
+{
+	ShmSysConfigAndInfo->SysInfo.CurGunSelected = sel;
+	ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc = NO_DEFINE;
+}
+
 void CheckIsAlternatvieByModelName()
 {
 	// 黑白機 ?
@@ -3430,7 +3598,7 @@ void StopProcessingLoop()
 
 void CreateWatchdog()
 {
-	if (DEBUG == NO)
+	if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == NO)
 	{
 		wtdFd = InitWatchDog();
 
@@ -3439,6 +3607,33 @@ void CreateWatchdog()
 	}
 }
 
+bool IsConnectorWholeIdle()
+{
+	bool result = true;
+
+	for (byte count = 0; count < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; count++)
+	{
+		if (chargingInfo[count]->SystemStatus != S_IDLE &&
+				chargingInfo[count]->SystemStatus != S_RESERVATION)
+		{
+			result = false;
+			break;
+		}
+	}
+
+	for (byte count = 0; count < ShmSysConfigAndInfo->SysConfig.AcConnectorCount; count++)
+	{
+		if (ac_chargingInfo[count]->SystemStatus != S_IDLE &&
+				ac_chargingInfo[count]->IsErrorOccur == NO)
+		{
+			result = false;
+			break;
+		}
+	}
+
+	return result;
+}
+
 int main(void)
 {
 	if(CreateShareMemory() == 0)
@@ -3457,14 +3652,14 @@ int main(void)
 		system("reboot -f");
 	}
 
-	PRINTF_FUNC("Chademo = %d, CCS = %d, GB = %d \n", CHAdeMO_QUANTITY, CCS_QUANTITY, GB_QUANTITY);
+	PRINTF_FUNC("Chademo = %d, CCS = %d, GB = %d, AC = %d \n",
+			CHAdeMO_QUANTITY, CCS_QUANTITY, GB_QUANTITY, AC_QUANTITY);
 	PRINTF_FUNC("\n"); PRINTF_FUNC("Initial SystemConfig and Info.......\n");
 	if (!InitialSystemDefaultConfig())
 	{
 		DEBUG_ERROR_MSG("InitialSystemDefaultConfig NG \n");
 		StopProcessingLoop();
 	}
-
 	PRINTF_FUNC("CheckConnectorTypeStatus. \n");
 	CheckGunTypeFromHw();
 	PRINTF_FUNC("CheckIsAlternatvieByModelName. \n");
@@ -3472,8 +3667,15 @@ int main(void)
 	PRINTF_FUNC("ModelName = %s\n", ShmSysConfigAndInfo->SysConfig.ModelName);
 	PRINTF_FUNC("InitialShareMemoryInfo \n");
 	InitialShareMemoryInfo();
+	PRINTF_FUNC("ChargerType (IEC or UL) = %d \n", ShmSysConfigAndInfo->SysInfo.ChargerType);
 	ChangeLcmByIndex(_LCM_INIT);
 	if (!CheckConnectorTypeStatus())
+		isModelNameMatch = false;
+
+	Initialization();
+	PRINTF_FUNC("Spawn all Task. \n");
+	SpawnTask();
+	if (!isModelNameMatch)
 	{
 		ShmStatusCodeData->AlarmCode.AlarmEvents.bits.ModelNameNoneMatchStestFail = YES;
 		ChangeLcmByIndex(_LCM_FIX);
@@ -3484,15 +3686,11 @@ int main(void)
 		KillTask();
 		StopProcessingLoop();
 	}
-	Initialization();
-	PRINTF_FUNC("Spawn all Task. \n");
-	SpawnTask();
 	PRINTF_FUNC("Module Name & HW info correct. Initialize.......\n");
 	CreateTimeoutFork();
 	PRINTF_FUNC("Self test. \n");
 	SelfTestRun();
 	StopSystemTimeoutDet();
-
 	PRINTF_FUNC("SelfTestSeq = %d, Work_Step = %d \n", ShmSysConfigAndInfo->SysInfo.SelfTestSeq, ShmPsuData->Work_Step);
 	if (ShmSysConfigAndInfo->SysInfo.SelfTestSeq == _STEST_FAIL ||
 			ShmPsuData->Work_Step == _NO_WORKING)
@@ -3503,6 +3701,8 @@ int main(void)
 			setChargerMode(gun_index, MODE_ALARM);
 		}
 		ChangeLcmByIndex(_LCM_FIX);
+		sleep(3);
+		KillTask();
 		StopProcessingLoop();
 	}
 	else
@@ -3520,14 +3720,14 @@ int main(void)
 	// 2. ouput fuse - 控制風扇轉速
 	CreateRfidFork();
 	// Create Watchdog
-	CreateWatchdog();
+	//CreateWatchdog();
 	// Main loop
 	PRINTF_FUNC("Main Loop. \n");
 	for (;;)
 	{
 		CheckOcppStatus();
 		ChkPrimaryStatus();
-		if ((ShmSysConfigAndInfo->SysInfo.PageIndex == _LCM_IDLE || ShmSysConfigAndInfo->SysInfo.PageIndex == _LCM_FIX)&&
+		if ((IsConnectorWholeIdle() || ShmSysConfigAndInfo->SysInfo.PageIndex == _LCM_FIX) &&
 				ShmSysConfigAndInfo->SysInfo.SystemTimeoutFlag != Timeout_ReturnToChargingGunDet)
 		{
 			CheckFactoryConfigFunction();
@@ -3539,6 +3739,12 @@ int main(void)
 		OcppRemoteStartChk();
 		// 讀卡邏輯
 		ScannerCardProcess();
+
+		if (_acgunIndex > 0 && isDetectPlugin() && !isCardScan)
+		{
+			ShmSysConfigAndInfo->SysInfo.SystemPage = _LCM_WAIT_FOR_PLUG;
+		}
+
 		for (byte gun_index = 0; gun_index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; gun_index++)
 		{
 			CheckGpioInStatus();
@@ -3613,6 +3819,8 @@ int main(void)
 								ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_NONE;
 							}
 						}
+						else
+							ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_NONE;
 
 						{ // Idle 正常程序起點
 							// 判斷是否有啟用檢查插槍
@@ -3626,7 +3834,7 @@ int main(void)
 											chargingInfo[gun_index]->IsAvailable)
 									{
 										PRINTF_FUNC("-----------------1----------------- %d \n", ShmSysConfigAndInfo->SysInfo.OrderCharging);
-										ShmSysConfigAndInfo->SysInfo.CurGunSelected = ShmSysConfigAndInfo->SysInfo.OrderCharging;
+										ChangeGunSelectByIndex(ShmSysConfigAndInfo->SysInfo.OrderCharging);
 										AddPlugInTimes(ShmSysConfigAndInfo->SysInfo.OrderCharging);
 										setChargerMode(ShmSysConfigAndInfo->SysInfo.OrderCharging, MODE_REASSIGN_CHECK);
 										ClearDetectPluginFlag();
@@ -3639,7 +3847,7 @@ int main(void)
 											chargingInfo[gun_index]->SystemStatus == S_IDLE)
 									{
 										PRINTF_FUNC("-----------------2----------------- \n");
-										ShmSysConfigAndInfo->SysInfo.CurGunSelected = gun_index;
+										ChangeGunSelectByIndex(gun_index);
 										AddPlugInTimes(gun_index);
 										strcpy((char *)chargingInfo[gun_index]->StartUserId, (char *)ShmSysConfigAndInfo->SysConfig.UserId);
 										PRINTF_FUNC("index = %d, CardNumber = %s \n", gun_index, chargingInfo[gun_index]->StartUserId);
@@ -3664,11 +3872,11 @@ int main(void)
 									chargingInfo[gun_index]->SystemStatus = S_IDLE;
 								}
 							}
-							else if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == _SYS_AUTHORIZE_FREE &&
+							else if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE &&
 									(chargingInfo[gun_index]->ConnectorPlugIn == YES && chargingInfo[gun_index]->IsAvailable))
 							{
 								PRINTF_FUNC("-----------------3----------------- \n");
-								ShmSysConfigAndInfo->SysInfo.CurGunSelected = gun_index;
+								ChangeGunSelectByIndex(gun_index);
 								AddPlugInTimes(gun_index);
 								setChargerMode(gun_index, MODE_REASSIGN_CHECK);
 								ClearDetectPluginFlag();
@@ -3679,27 +3887,38 @@ int main(void)
 								if (ShmSysConfigAndInfo->SysInfo.CurGunSelected == gun_index)
 									ShmSysConfigAndInfo->SysInfo.ConnectorPage = _LCM_IDLE;
 
-								if (ShmSysConfigAndInfo->SysConfig.TotalConnectorCount > 1 &&
+								if ((ShmSysConfigAndInfo->SysConfig.TotalConnectorCount + ShmSysConfigAndInfo->SysConfig.AcConnectorCount) > 1 &&
 										ShmSysConfigAndInfo->SysInfo.PageIndex != _LCM_AUTHORIZING &&
 										ShmSysConfigAndInfo->SysInfo.PageIndex != _LCM_AUTHORIZ_FAIL &&
 										ShmSysConfigAndInfo->SysInfo.PageIndex != _LCM_AUTHORIZ_COMP &&
 										ShmSysConfigAndInfo->SysInfo.PageIndex != _LCM_WAIT_FOR_PLUG)
 								{
+									bool isReturnTimeout = false;
 									for (byte count = 0; count < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; count++)
 									{
-										if (count != ShmSysConfigAndInfo->SysInfo.CurGunSelected)
+										if (count != ShmSysConfigAndInfo->SysInfo.CurGunSelected ||
+												(ShmSysConfigAndInfo->SysConfig.AcConnectorCount > 0 &&
+													ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc == DEFAULT_AC_INDEX))
 										{
 											if ((chargingInfo[count]->SystemStatus >= S_REASSIGN_CHECK && chargingInfo[count]->SystemStatus <= S_COMPLETE) ||
-													(chargingInfo[count]->SystemStatus >= S_CCS_PRECHARGE_ST0 && chargingInfo[count]->SystemStatus <= S_CCS_PRECHARGE_ST1)	)
+													(chargingInfo[count]->SystemStatus >= S_CCS_PRECHARGE_ST0 && chargingInfo[count]->SystemStatus <= S_CCS_PRECHARGE_ST1))
 											{
+												isReturnTimeout = true;
 												StartSystemTimeoutDet(Timeout_ReturnToChargingGunDet);
 											}
-											else
-											{
-												StopSystemTimeoutDet();
-											}
 										}
 									}
+
+									if (!isReturnTimeout && ShmSysConfigAndInfo->SysConfig.AcConnectorCount > 0 &&
+											ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc == NO_DEFINE &&
+											ac_chargingInfo[0]->SystemStatus >= S_PREPARNING && ac_chargingInfo[0]->SystemStatus <= S_COMPLETE)
+									{
+										isReturnTimeout = true;
+										StartSystemTimeoutDet(Timeout_ReturnToChargingGunDet);
+									}
+
+									if (!isReturnTimeout)
+										StopSystemTimeoutDet();
 								}
 							}
 						} // Idle 正常程序終點
@@ -3756,12 +3975,15 @@ int main(void)
 					// 此狀態下~ 控制權在於 PSU 及 EV小板 Process
 					if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag == _REASSIGNED_NONE ||
 							ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_AVER)
-						setChargerMode(gun_index, MODE_PRECHARGE);
+					{
+							setChargerMode(gun_index, MODE_PRECHARGE);
+					}
 					else if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag == _REASSIGNED_RELAY_M_TO_A &&
 						ShmSysConfigAndInfo->SysInfo.BridgeRelayStatus == NO)
 					{
 						PRINTF_FUNC("=============Smart Charging : _REASSIGNED_COMP============= Step 6 \n");
 						ShmSysConfigAndInfo->SysInfo.MainChargingMode = _MAIN_CHARGING_MODE_AVER;
+						ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_NONE;
 					}
 
 					//PRINTF_FUNC("CurGunSelected = %d, gun_index = %d \n", ShmSysConfigAndInfo->SysInfo.CurGunSelected, gun_index);
@@ -3778,13 +4000,6 @@ int main(void)
 						StartGunInfoTimeoutDet(gun_index, Timeout_Preparing);
 					}
 
-					if (ShmSysConfigAndInfo->SysInfo.ReAssignedFlag != _REASSIGNED_NONE)
-						ShmSysConfigAndInfo->SysInfo.ReAssignedFlag = _REASSIGNED_NONE;
-
-//					if (((ShmPsuData->SystemPresentPsuQuantity > 0 &&
-//							ShmPsuData->PsuGroup[gun_index].GroupPresentPsuQuantity > 0 &&
-//							ShmPsuData->PsuGroup[gun_index].GroupAvailablePower > 10) &&
-//							chargingInfo[gun_index]->AvailableChargingPower > 10))
 					if (ShmPsuData->SystemPresentPsuQuantity > 0 && ShmPsuData->SystemAvailablePower > 10)
 					{
 						setChargerMode(gun_index, MODE_PREPARE_FOR_EV);
@@ -3870,6 +4085,11 @@ int main(void)
 							// GFD 錯誤停止
 							RecordAlarmCode("012234");
 						}
+						else if (chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING)
+						{
+							// GFD 警告
+							RecordAlarmCode("012296");
+						}
 					}
 					else if (chargingInfo[gun_index]->Type == _Type_GB)
 					{
@@ -3884,11 +4104,17 @@ int main(void)
 							// GFD 錯誤停止
 							RecordAlarmCode("012236");
 						}
+						else if (chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING)
+						{
+							// GFD 警告
+							RecordAlarmCode("012298");
+						}
 					}
 					else if (chargingInfo[gun_index]->Type == _Type_CCS_2)
 					{
 						// 檢查樁端的 GFD 結果
-						if (chargingInfo[gun_index]->GroundFaultStatus == GFD_PASS)
+						if (chargingInfo[gun_index]->GroundFaultStatus == GFD_PASS ||
+								chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING)
 						{
 							setChargerMode(gun_index, MODE_CCS_PRECHARGE_STEP0);
 						}
@@ -3898,6 +4124,11 @@ int main(void)
 							// GFD 錯誤停止
 							RecordAlarmCode("012235");
 						}
+						else if (chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING)
+						{
+							// GFD 警告
+							RecordAlarmCode("012297");
+						}
 					}
 
 					if (isEvBoardStopChargeFlag(gun_index) == YES ||
@@ -3940,6 +4171,13 @@ int main(void)
 							RecordAlarmCode("012289");
 							ChargingTerminalProcess(gun_index);
 						}
+						else if (chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING)
+						{
+							// GFD 警告
+							RecordAlarmCode("012296");
+						}
+						else
+							CleanAlarmCodeByString("012296");
 					}
 					else if (chargingInfo[gun_index]->Type == _Type_GB)
 					{
@@ -3956,6 +4194,13 @@ int main(void)
 							RecordAlarmCode("012290");
 							ChargingTerminalProcess(gun_index);
 						}
+						else if (chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING)
+						{
+							// GFD 警告
+							RecordAlarmCode("012298");
+						}
+						else
+							CleanAlarmCodeByString("012298");
 					}
 					else if (chargingInfo[gun_index]->Type == _Type_CCS_2)
 					{
@@ -3971,6 +4216,13 @@ int main(void)
 							RecordAlarmCode("012288");
 							ChargingTerminalProcess(gun_index);
 						}
+						else if (chargingInfo[gun_index]->GroundFaultStatus == GFD_WARNING)
+						{
+							// GFD 警告
+							RecordAlarmCode("012297");
+						}
+						else
+							CleanAlarmCodeByString("012297");
 					}
 
 					if (isEvBoardStopChargeFlag(gun_index) ||
@@ -4132,9 +4384,29 @@ int main(void)
 		}
 		else
 		{
-			ChangeLcmByIndex(ShmSysConfigAndInfo->SysInfo.ConnectorPage);
+			bool dcPageRun = false;
+			if (_acgunIndex > 0 && ShmSysConfigAndInfo->SysInfo.CurGunSelectedByAc != NO_DEFINE)
+			{
+				if  (ac_chargingInfo[0]->SystemStatus == S_IDLE)
+					ChangeLcmByIndex(_LCM_IDLE);
+				else if (ac_chargingInfo[0]->SystemStatus == S_PREPARNING)
+					ChangeLcmByIndex(_LCM_PRE_CHARGE);
+				else if (ac_chargingInfo[0]->SystemStatus == S_CHARGING)
+					ChangeLcmByIndex(_LCM_CHARGING);
+				else if (ac_chargingInfo[0]->SystemStatus == S_TERMINATING ||
+						ac_chargingInfo[0]->SystemStatus == S_COMPLETE)
+					ChangeLcmByIndex(_LCM_COMPLETE);
+				else
+					dcPageRun = true;
+			}
+			else
+				dcPageRun = true;
+
+			if (dcPageRun)
+				ChangeLcmByIndex(ShmSysConfigAndInfo->SysInfo.ConnectorPage);
 		}
 
+
 		write(wtdFd, "a", 1);
 		usleep(whileLoopTime);
 	}

+ 1 - 0
EVSE/Projects/DS60-120/Apps/web.sh

@@ -0,0 +1 @@
+/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf  -m /lib

BIN
EVSE/Projects/DS60-120/Images/FactoryDefaultConfig.bin


BIN
EVSE/Projects/DS60-120/Images/MLO


BIN
EVSE/Projects/DS60-120/Images/ramdisk.gz


BIN
EVSE/Projects/DS60-120/Images/u-boot.img


BIN
EVSE/Projects/DS60-120/Images/zImage


Plik diff jest za duży
+ 32722 - 32722
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_System.map


Plik diff jest za duży
+ 1413 - 1399
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_kallsyms1.S


Plik diff jest za duży
+ 1413 - 1399
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_kallsyms2.S


BIN
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_vmlinux1


BIN
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_vmlinux2


+ 1 - 1
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.version

@@ -1 +1 @@
-24
+25

+ 98 - 18
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/.am335x-evm.dtb.dts.tmp

@@ -1199,22 +1199,35 @@
 
 
 
+   0x020 (((1 << 5) | (1 << 3)) | 7)
+   0x024 (((1 << 5) | (1 << 3)) | 7)
+   0x028 (((1 << 5) | (1 << 3)) | 7)
+   0x02C (((1 << 5) | (1 << 3)) | 7)
    0x144 (((1 << 5) | (1 << 3)) | 7)
    0x1B0 (((1 << 3)) | 7)
    0x1B4 (((1 << 5) | (1 << 3)) | 7)
 
 
-   0x08C (((1 << 3)) | 7)
-   0x0A0 (((1 << 3)) | 7)
-   0x0A4 (((1 << 3)) | 7)
-   0x0A8 (((1 << 3)) | 7)
-   0x0AC (((1 << 3)) | 7)
-   0x0B0 (((1 << 3)) | 7)
-   0x0B4 (((1 << 3)) | 7)
+   0x030 (((1 << 5) | (1 << 3)) | 7)
+   0x034 (((1 << 5) | (1 << 3)) | 7)
+   0x038 (((1 << 5) | (1 << 3)) | 7)
+   0x03C (((1 << 5) | (1 << 3)) | 7)
+
+
+   0x0EC (((1 << 3)) | 7)
+   0x0E4 (((1 << 3)) | 7)
    0x0E8 (((1 << 5) | (1 << 3)) | 7)
-   0x0E0 (((1 << 3)) | 7)
+   0x0E0 (((1 << 5) | (1 << 3)) | 7)
+
 
+   0x194 (((1 << 5) | (1 << 3)) | 7)
+   0x1A0 (((1 << 5) | (1 << 3)) | 7)
+   0x19C (((1 << 5) | (1 << 3)) | 7)
+   0x190 (((1 << 3)) | 7)
+   0x1A4 (((1 << 3)) | 7)
+   0x198 (((1 << 3)) | 7)
    0x1A8 (((1 << 3)) | 7)
+
   >;
  };
 
@@ -1259,7 +1272,14 @@
    0x164 (0 | 1)
   >;
  };
-# 136 "arch/arm/boot/dts/am335x-evm.dts"
+
+ uart5_pins: pinmux_uart5_pins {
+  pinctrl-single,pins = <
+   0x0C0 (0 | 4)
+   0x0C4 (((1 << 5) | (1 << 4)) | 4)
+  >;
+ };
+
  clkout2_pin: pinmux_clkout2_pin {
   pinctrl-single,pins = <
    0x1b4 (0 | 3)
@@ -1310,12 +1330,12 @@
   pinctrl-single,pins = <
 
 
-
-
+   0x108 (((1 << 5) | (1 << 4)) | 0)
+   0x10C(((1 << 5) | (1 << 4)) | 0)
    0x110 (((1 << 5) | (1 << 4)) | 0)
-   0x118 (((1 << 5) | (1 << 4)) | 0)
    0x12c (((1 << 5) | (1 << 4)) | 0)
    0x130 (((1 << 5) | (1 << 4)) | 0)
+   0x118 (((1 << 5) | (1 << 4)) | 0)
    0x134 (((1 << 5) | (1 << 4)) | 0)
    0x138 (((1 << 5) | (1 << 4)) | 0)
    0x13c (((1 << 5) | (1 << 4)) | 0)
@@ -1326,6 +1346,23 @@
    0x124 (0 | 0)
    0x128 (0 | 0)
 
+
+   ((((0x878)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
+   ((((0x888)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 2)
+
+   ((((0x858)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
+   ((((0x85c)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
+   ((((0x844)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
+   ((((0x860)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
+   ((((0x864)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
+   ((((0x868)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
+   ((((0x86c)) & 0xffff) - (0x0800)) (((1 << 5) | (1 << 4)) | 1)
+   ((((0x840)) & 0xffff) - (0x0800)) (0 | 1)
+   ((((0x848)) & 0xffff) - (0x0800)) (0 | 1)
+   ((((0x84c)) & 0xffff) - (0x0800)) (0 | 1)
+   ((((0x850)) & 0xffff) - (0x0800)) (0 | 1)
+   ((((0x854)) & 0xffff) - (0x0800)) (0 | 1)
+
   >;
  };
 
@@ -1345,6 +1382,23 @@
    0x13c (((1 << 5)) | 7)
    0x140 (((1 << 5)) | 7)
 
+
+   ((((0x888)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+   ((((0x840)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+   ((((0x844)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+   ((((0x848)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+   ((((0x84c)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+   ((((0x850)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+   ((((0x854)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+   ((((0x858)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+   ((((0x85c)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+   ((((0x860)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+   ((((0x864)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+   ((((0x868)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+   ((((0x86c)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+
+   ((((0x878)) & 0xffff) - (0x0800)) (((1 << 5)) | 7)
+
   >;
  };
 
@@ -1383,7 +1437,14 @@
    0x17C (((1 << 5)) | 2)
   >;
  };
-# 280 "arch/arm/boot/dts/am335x-evm.dts"
+
+ dcan1_pins_default: dcan1_pins_default {
+  pinctrl-single,pins = <
+   0x168 (((1 << 4)) | 2)
+   0x16C (((1 << 5)) | 2)
+  >;
+ };
+# 327 "arch/arm/boot/dts/am335x-evm.dts"
 };
 
 
@@ -1415,7 +1476,14 @@
 
  status = "okay";
 };
-# 319 "arch/arm/boot/dts/am335x-evm.dts"
+
+&uart5 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart5_pins>;
+
+ status = "okay";
+};
+
 &i2c0 {
  pinctrl-names = "default";
  pinctrl-0 = <&i2c0_pins>;
@@ -1478,7 +1546,7 @@
 &elm {
  status = "okay";
 };
-# 402 "arch/arm/boot/dts/am335x-evm.dts"
+# 449 "arch/arm/boot/dts/am335x-evm.dts"
 &gpmc {
  status = "okay";
  pinctrl-names = "default", "sleep";
@@ -1664,7 +1732,7 @@
   };
  };
 };
-# 508 "arch/arm/boot/dts/am335x-evm.dts" 2
+# 555 "arch/arm/boot/dts/am335x-evm.dts" 2
 
 &tps {
  vcc1-supply = <&vbat>;
@@ -1747,6 +1815,7 @@
  pinctrl-names = "default", "sleep";
  pinctrl-0 = <&cpsw_default>;
  pinctrl-1 = <&cpsw_sleep>;
+ dual_emac = <1>;
  status = "okay";
 };
 
@@ -1755,15 +1824,20 @@
  pinctrl-0 = <&davinci_mdio_default>;
  pinctrl-1 = <&davinci_mdio_sleep>;
  status = "okay";
-
 };
 
 &cpsw_emac0 {
  phy_id = <&davinci_mdio>, <1>;
   phy-mode = "mii";
+  dual_emac_res_vlan = <1>;
+};
 
+&cpsw_emac1 {
+ phy_id = <&davinci_mdio>, <2>;
+  phy-mode = "mii";
+  dual_emac_res_vlan = <2>;
 };
-# 614 "arch/arm/boot/dts/am335x-evm.dts"
+
 &tscadc {
  status = "okay";
 
@@ -1810,3 +1884,9 @@
  pinctrl-names = "default";
  pinctrl-0 = <&dcan0_pins_default>;
 };
+
+&dcan1 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&dcan1_pins_default>;
+};

+ 80 - 35
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dts

@@ -64,23 +64,36 @@
 		pinctrl-single,pins = <
 		
 			/** Offset: 0x800 */
-			/** GPIO 0 */ 
+			/** GPIO 0 */   
+			0x020 (PIN_INPUT | MUX_MODE7)			/* GPMC_AD8			=> 	GPIO0_22 */	/*ID BD1_1*/
+			0x024 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD9			=>	GPIO0_23 */	/*ID BD1_2*/
+			0x028 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD10		=>	GPIO0_26 */	/*IO BD1_1*/
+			0x02C (PIN_INPUT | MUX_MODE7)    		/* GPMC_AD11		=>	GPIO0_27 */	/*IO BD1_2*/
 			0x144 (PIN_INPUT | MUX_MODE7)    			/* RMII1_REF_CLK		=>	GPIO0_29 */	/*USB 0 OCP detection*/
 			0x1B0 (PIN_OUTPUT | MUX_MODE7)			/*XDMA_EVENT_INTR0	=>	GPIO0_19 */	/*AM_RFID_RST*/
 			0x1B4 (PIN_INPUT | MUX_MODE7)			/*XDMA_EVENT_INTR1	=>	GPIO0_20 */	/*AM_RFID_ICC*/
-			/** GPIO 1 */			
+			
+			/** GPIO 1 */
+			0x030 (PIN_INPUT | MUX_MODE7)			/* GPMC_AD12	=> 	GPIO1_12 */	/*ID BD2_1*/
+			0x034 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD13	=>	GPIO1_13 */	/*ID BD2_2*/
+			0x038 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD14	=>	GPIO1_14 */	/*IO BD2_1*/
+			0x03C (PIN_INPUT | MUX_MODE7)    		/* GPMC_AD15	=>	GPIO1_15 */	/*IO BD2_2*/
+			
 			/** GPIO 2 */
-			0x08C (PIN_OUTPUT | MUX_MODE7)			/*GPMC_CLK	=>	GPIO2_1*/	/*Speaker*/
-			0x0A0 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA0	=>	GPIO2_6*/	/*Panel LED control-BB_LEDR1*/
-			0x0A4 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA1	=>	GPIO2_7*/	/*Panel LED control-BB_LEDG1*/
-			0x0A8 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA2	=>	GPIO2_8*/	/*Panel LED control-BB_LEDB1*/
-			0x0AC (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA3	=>	GPIO2_9*/	/*Panel LED control-BB_LEDR2*/
-			0x0B0 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA4	=>	GPIO2_10*/	/*Panel LED control-BB_LEDG2*/
-			0x0B4 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA5	=>	GPIO2_11*/	/*Panel LED control-BB_LEDB2*/
-			0x0E8 (PIN_INPUT | MUX_MODE7)			/*LCD_PCLK	=>	GPIO2_24*/	/*communication board proximity*/
-			0x0E0 (PIN_OUTPUT | MUX_MODE7)			/*LCD_VSYNC	=>	GPIO2_22*/	/*Breath LED*/
+			0x0EC (PIN_OUTPUT | MUX_MODE7)			/*LCD_AC_BIAS_EN	=>	GPIO2_25*/	/*RS-485 for module DE control*/
+			0x0E4 (PIN_OUTPUT | MUX_MODE7)			/*LCD_HSYNC		=>	GPIO2_23*/	/*RS-485 for module RE control*/
+			0x0E8 (PIN_INPUT | MUX_MODE7)			/*LCD_PCLK		=>	GPIO2_24*/	/*CCS communication board 1 proximity*/
+			0x0E0 (PIN_INPUT | MUX_MODE7)			/*LCD_VSYNC		=>	GPIO2_22*/	/*CCS communication board 2 proximity*/
+			
 			/** GPIO 3 */
-			0x1A8 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_AXR1	=>	GPIO3_20 */	/*control MCU to output CP PWM*/
+			0x194 (PIN_INPUT | MUX_MODE7)			/*MCASP0_FSX		=>	GPIO3_15*/	/*Emergency Stop button detect*/
+			0x1A0 (PIN_INPUT | MUX_MODE7)			/*MCASP0_ACLKR	=>	GPIO3_18*/	/*USB1 OCP detect*/
+			0x19C (PIN_INPUT | MUX_MODE7)			/*MCASP0_AHCLKR	=>	GPIO3_17*/	/*Emergency IO for AM3352 and STM32F407*/
+			0x190 (PIN_OUTPUT | MUX_MODE7)			/*MCASP0_ACLKX	=>	GPIO3_14*/	/*Ethernet PHY reset*/
+			0x1A4 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_FSR		=>	GPIO3_19 */	/*SMR Enable control_1*/
+			0x198 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_AXR0	=>	GPIO3_16 */	/*CSU board function OK indicator.*/
+			0x1A8 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_AXR1	=>	GPIO3_20 */	/*SMR Enable control_2*/
+			
 		>;
 	};
 	
@@ -125,14 +138,14 @@
 			0x164 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* ECAP0_IN_PWM0_OUT		=>	uart3_txd */
 		>;
 	};
-#if 0
+
 	uart5_pins: pinmux_uart5_pins {
 		pinctrl-single,pins = <
-			0x0C0 (PIN_INPUT_PULLUP | MUX_MODE4)		/* LCD_DATA8	=>	UART5_RXD*/
-			0x0C4 (PIN_OUTPUT_PULLDOWN | MUX_MODE4)	/* LCD_DATA9	=>	UART5_TXD*/
+			0x0C0 (PIN_OUTPUT_PULLDOWN | MUX_MODE4)		/* LCD_DATA8	=>	DUART5_TX*/
+			0x0C4 (PIN_INPUT_PULLUP | MUX_MODE4)			/* LCD_DATA9	=>	UART5_RX*/
 		>;
 	};
-#endif	
+	
 	clkout2_pin: pinmux_clkout2_pin {
 		pinctrl-single,pins = <
 			0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* xdma_event_intr1.clkout2 */
@@ -183,12 +196,12 @@
 		pinctrl-single,pins = <					
 		
 			/* Slave 1 */
-			//0x108 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* MII1_COL.gmii1_col */
-			//0x10C(PIN_INPUT_PULLDOWN | MUX_MODE0)		/* MII1_CRS.MII1_CRS */
+			0x108 (PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_COL.gmii1_col */
+			0x10C(PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_CRS.MII1_CRS */
 			0x110 (PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_RX_ER.gmii1_rxerr */
-			0x118 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxdv.mii1_rxdv */
 			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_txclk.mii1_txclk */
 			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxclk.mii1_rxclk */
+			0x118 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxdv.mii1_rxdv */
 			0x134 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd3.rgmii1_rd3 */
 			0x138 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd2.rgmii1_rd2 */
 			0x13c (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd1.rgmii1_rd1 */
@@ -197,7 +210,24 @@
 			0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd3.rgmii1_td3 */
 			0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd2.rgmii1_td2 */
 			0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd1.rgmii1_td1 */
-			0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd0.rgmii1_td0 */      
+			0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd0.rgmii1_td0 */      	
+			
+			/* Slave 2 */
+			AM33XX_IOPAD(0x878, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_ben1.mii2_col */
+			AM33XX_IOPAD(0x888, PIN_INPUT_PULLUP | MUX_MODE2)					/* GPMC_CSn3.rmii2_crs_dv*/								
+			/*AM33XX_IOPAD(0x874, PIN_INPUT_PULLUP | MUX_MODE1)*/					/* gpmc_wpn.mii2_rxerr */
+			AM33XX_IOPAD(0x858, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a6.mii2_txclk */
+			AM33XX_IOPAD(0x85c, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a7.mii2_rxclk */
+			AM33XX_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a1.mii2_rxdv */
+			AM33XX_IOPAD(0x860, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a8.mii2_rxd3 */
+			AM33XX_IOPAD(0x864, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a9.mii2_rxd2 */
+			AM33XX_IOPAD(0x868, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a10.mii2_rxd1 */
+			AM33XX_IOPAD(0x86c, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a11.mii2_rxd0 */
+			AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a0.mii2_txen */
+			AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a2.mii2_txd3 */
+			AM33XX_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a3.mii2_txd2 */
+			AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a4.mii2_txd1 */
+			AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a5.mii2_txd0 */
 
 		>;
 	};
@@ -218,6 +248,23 @@
 			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
 			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)		
 			
+			/* Slave 2 */
+			AM33XX_IOPAD(0x888, PIN_INPUT_PULLDOWN | MUX_MODE7)					/* GPMC_CSn3.rmii2_crs_dv*/	
+			AM33XX_IOPAD(0x840, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a0.mii2_txen */
+			AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a1.mii2_rxdv */
+			AM33XX_IOPAD(0x848, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a2.mii2_txd3 */
+			AM33XX_IOPAD(0x84c, PIN_INPUT_PULLDOWN | MUX_MODE7)			/* gpmc_a3.mii2_txd2 */
+			AM33XX_IOPAD(0x850, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a4.mii2_txd1 */
+			AM33XX_IOPAD(0x854, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a5.mii2_txd0 */
+			AM33XX_IOPAD(0x858, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a6.mii2_txclk */
+			AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a7.mii2_rxclk */
+			AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a8.mii2_rxd3 */
+			AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a9.mii2_rxd2 */
+			AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a10.mii2_rxd1 */
+			AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a11.mii2_rxd0 */
+			/*AM33XX_IOPAD(0x874, PIN_INPUT_PULLDOWN | MUX_MODE7)*/	/* gpmc_wpn.mii2_rxerr */
+			AM33XX_IOPAD(0x878, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_ben1.mii2_col */
+			
 		>;
 	};
 
@@ -256,14 +303,14 @@
 			0x17C (PIN_INPUT_PULLDOWN | MUX_MODE2)		/* uart1_rtsn	=>	d_can0_rx */
 		>;
 	};
-#if 0	
+	
 	dcan1_pins_default: dcan1_pins_default {
 		pinctrl-single,pins = <
 			0x168 (PIN_OUTPUT_PULLUP | MUX_MODE2)		/* UART0_CTSn		=>	d_can1_tx */
 			0x16C (PIN_INPUT_PULLDOWN | MUX_MODE2)	/* UART0_RTSn		=>	d_can1_rx */
 		>;
 	};
-
+#if 0
 	ehrpwm1_pins: ehrpwm1_pins {
 		pinctrl-single,pins = <			
 			0x0C8 (PIN_OUTPUT | MUX_MODE2) /* LCD_DATA10.eHRPWM1A */
@@ -308,14 +355,14 @@
 
 	status = "okay";
 };
-#if 0
+
 &uart5 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart5_pins>;
 
 	status = "okay";
 };
-#endif
+
 &i2c0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c0_pins>;
@@ -326,11 +373,11 @@
 	tps: tps@2d {
 		reg = <0x2d>;
 	};
-
+	
 /*	rtc0: rtc@51 {
-		compatible = "nxp,pcf85063";
-		reg = <0x51>;
-	};*/
+                compatible = "nxp,pcf85063";
+                reg = <0x51>;
+        };*/	
 };
 #if 1
 &i2c1 {
@@ -587,6 +634,7 @@
 	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&cpsw_default>;
 	pinctrl-1 = <&cpsw_sleep>;
+	dual_emac = <1>;
 	status = "okay";
 };
 
@@ -595,21 +643,19 @@
 	pinctrl-0 = <&davinci_mdio_default>;
 	pinctrl-1 = <&davinci_mdio_sleep>;
 	status = "okay";
-	//reset-gpios = <&gpio3 14 GPIO_ACTIVE_LOW>;
 };
 
 &cpsw_emac0 {
 	phy_id = <&davinci_mdio>, <1>;
  	phy-mode = "mii";
-
+ 	dual_emac_res_vlan = <1>;
 };
-#if 0
+
 &cpsw_emac1 {
 	phy_id = <&davinci_mdio>, <2>;
  	phy-mode = "mii";
-
+ 	dual_emac_res_vlan = <2>;
 };
-#endif
 
 &tscadc {
 	status = "okay";
@@ -657,10 +703,9 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&dcan0_pins_default>;
 };
-#if 0
+
 &dcan1 {
 	status = "okay";	
 	pinctrl-names = "default";
 	pinctrl-0 = <&dcan1_pins_default>;
 };
-#endif

+ 6 - 13
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/lib/.gen_crc32table.cmd

@@ -5,23 +5,18 @@ source_lib/gen_crc32table := lib/gen_crc32table.c
 deps_lib/gen_crc32table := \
   /usr/include/stdc-predef.h \
   /usr/include/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
   /usr/include/x86_64-linux-gnu/bits/types.h \
   /usr/include/x86_64-linux-gnu/bits/typesizes.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/libio.h \
-  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
-    $(wildcard include/config/h.h) \
-  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \
@@ -33,11 +28,9 @@ deps_lib/gen_crc32table := \
     $(wildcard include/config/crc32/bit.h) \
     $(wildcard include/config/64bit.h) \
   /usr/include/inttypes.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h \
   /usr/include/stdint.h \
   /usr/include/x86_64-linux-gnu/bits/wchar.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \
 
 lib/gen_crc32table: $(deps_lib/gen_crc32table)
 

+ 13 - 31
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/scripts/.conmakehash.cmd

@@ -5,23 +5,18 @@ source_scripts/conmakehash := scripts/conmakehash.c
 deps_scripts/conmakehash := \
   /usr/include/stdc-predef.h \
   /usr/include/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
   /usr/include/x86_64-linux-gnu/bits/types.h \
   /usr/include/x86_64-linux-gnu/bits/typesizes.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/libio.h \
-  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
-    $(wildcard include/config/h.h) \
-  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \
@@ -29,42 +24,29 @@ deps_scripts/conmakehash := \
   /usr/include/stdlib.h \
   /usr/include/x86_64-linux-gnu/bits/waitflags.h \
   /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn-common.h \
-  /usr/include/x86_64-linux-gnu/sys/types.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/time_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
   /usr/include/endian.h \
   /usr/include/x86_64-linux-gnu/bits/endian.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
-  /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
+  /usr/include/x86_64-linux-gnu/sys/types.h \
+  /usr/include/time.h \
   /usr/include/x86_64-linux-gnu/sys/select.h \
   /usr/include/x86_64-linux-gnu/bits/select.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
+  /usr/include/x86_64-linux-gnu/bits/sigset.h \
+  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/select2.h \
   /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
-  /usr/include/x86_64-linux-gnu/bits/sysmacros.h \
   /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
-  /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
-  /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
   /usr/include/alloca.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib.h \
   /usr/include/sysexits.h \
   /usr/include/string.h \
-  /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
-  /usr/include/strings.h \
-  /usr/include/x86_64-linux-gnu/bits/strings_fortified.h \
-  /usr/include/x86_64-linux-gnu/bits/string_fortified.h \
+  /usr/include/xlocale.h \
+  /usr/include/x86_64-linux-gnu/bits/string.h \
+  /usr/include/x86_64-linux-gnu/bits/string2.h \
+  /usr/include/x86_64-linux-gnu/bits/string3.h \
   /usr/include/ctype.h \
 
 scripts/conmakehash: $(deps_scripts/conmakehash)

+ 15 - 33
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/scripts/.kallsyms.cmd

@@ -6,23 +6,18 @@ deps_scripts/kallsyms := \
     $(wildcard include/config/page/offset.h) \
   /usr/include/stdc-predef.h \
   /usr/include/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
   /usr/include/x86_64-linux-gnu/bits/types.h \
   /usr/include/x86_64-linux-gnu/bits/typesizes.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/libio.h \
-  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
-    $(wildcard include/config/h.h) \
-  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \
@@ -30,44 +25,31 @@ deps_scripts/kallsyms := \
   /usr/include/stdlib.h \
   /usr/include/x86_64-linux-gnu/bits/waitflags.h \
   /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn-common.h \
-  /usr/include/x86_64-linux-gnu/sys/types.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/time_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
   /usr/include/endian.h \
   /usr/include/x86_64-linux-gnu/bits/endian.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
-  /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
+  /usr/include/x86_64-linux-gnu/sys/types.h \
+  /usr/include/time.h \
   /usr/include/x86_64-linux-gnu/sys/select.h \
   /usr/include/x86_64-linux-gnu/bits/select.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
+  /usr/include/x86_64-linux-gnu/bits/sigset.h \
+  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/select2.h \
   /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
-  /usr/include/x86_64-linux-gnu/bits/sysmacros.h \
   /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
-  /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
-  /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
   /usr/include/alloca.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib.h \
   /usr/include/string.h \
-  /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
-  /usr/include/strings.h \
-  /usr/include/x86_64-linux-gnu/bits/strings_fortified.h \
-  /usr/include/x86_64-linux-gnu/bits/string_fortified.h \
+  /usr/include/xlocale.h \
+  /usr/include/x86_64-linux-gnu/bits/string.h \
+  /usr/include/x86_64-linux-gnu/bits/string2.h \
+  /usr/include/x86_64-linux-gnu/bits/string3.h \
   /usr/include/ctype.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/limits.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/syslimits.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
   /usr/include/limits.h \
   /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
   /usr/include/x86_64-linux-gnu/bits/local_lim.h \

+ 13 - 36
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/scripts/.sortextable.cmd

@@ -8,49 +8,33 @@ deps_scripts/sortextable := \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
   /usr/include/x86_64-linux-gnu/bits/types.h \
   /usr/include/x86_64-linux-gnu/bits/typesizes.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/time_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
+  /usr/include/time.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
   /usr/include/endian.h \
   /usr/include/x86_64-linux-gnu/bits/endian.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
-  /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
   /usr/include/x86_64-linux-gnu/sys/select.h \
   /usr/include/x86_64-linux-gnu/bits/select.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
+  /usr/include/x86_64-linux-gnu/bits/sigset.h \
+  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/select2.h \
   /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
-  /usr/include/x86_64-linux-gnu/bits/sysmacros.h \
   /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
-  /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
-  /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
   /usr/include/x86_64-linux-gnu/sys/mman.h \
   /usr/include/x86_64-linux-gnu/bits/mman.h \
   /usr/include/x86_64-linux-gnu/bits/mman-linux.h \
-  /usr/include/x86_64-linux-gnu/bits/mman-shared.h \
   /usr/include/x86_64-linux-gnu/sys/stat.h \
   /usr/include/x86_64-linux-gnu/bits/stat.h \
   /usr/include/getopt.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_core.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_ext.h \
   /usr/include/elf.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h \
   /usr/include/stdint.h \
-  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
   /usr/include/x86_64-linux-gnu/bits/wchar.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \
   /usr/include/x86_64-linux-gnu/bits/auxv.h \
   /usr/include/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl.h \
@@ -60,13 +44,10 @@ deps_scripts/sortextable := \
   /usr/include/x86_64-linux-gnu/bits/setjmp.h \
   /usr/include/x86_64-linux-gnu/bits/setjmp2.h \
   /usr/include/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/libio.h \
-  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
-    $(wildcard include/config/h.h) \
-  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \
@@ -74,23 +55,19 @@ deps_scripts/sortextable := \
   /usr/include/stdlib.h \
   /usr/include/x86_64-linux-gnu/bits/waitflags.h \
   /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn-common.h \
   /usr/include/alloca.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib.h \
   /usr/include/string.h \
-  /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
-  /usr/include/strings.h \
-  /usr/include/x86_64-linux-gnu/bits/strings_fortified.h \
-  /usr/include/x86_64-linux-gnu/bits/string_fortified.h \
+  /usr/include/xlocale.h \
+  /usr/include/x86_64-linux-gnu/bits/string.h \
+  /usr/include/x86_64-linux-gnu/bits/string2.h \
+  /usr/include/x86_64-linux-gnu/bits/string3.h \
   /usr/include/unistd.h \
   /usr/include/x86_64-linux-gnu/bits/posix_opt.h \
   /usr/include/x86_64-linux-gnu/bits/environments.h \
   /usr/include/x86_64-linux-gnu/bits/confname.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_posix.h \
   /usr/include/x86_64-linux-gnu/bits/unistd.h \
   tools/include/tools/be_byteshift.h \
   tools/include/tools/le_byteshift.h \

+ 5 - 10
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/scripts/basic/.bin2c.cmd

@@ -5,23 +5,18 @@ source_scripts/basic/bin2c := scripts/basic/bin2c.c
 deps_scripts/basic/bin2c := \
   /usr/include/stdc-predef.h \
   /usr/include/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
   /usr/include/x86_64-linux-gnu/bits/types.h \
   /usr/include/x86_64-linux-gnu/bits/typesizes.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/libio.h \
-  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
-    $(wildcard include/config/h.h) \
-  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \

+ 20 - 38
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/scripts/basic/.fixdep.cmd

@@ -12,81 +12,61 @@ deps_scripts/basic/fixdep := \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
   /usr/include/x86_64-linux-gnu/bits/types.h \
   /usr/include/x86_64-linux-gnu/bits/typesizes.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/time_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
+  /usr/include/time.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
   /usr/include/endian.h \
   /usr/include/x86_64-linux-gnu/bits/endian.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
-  /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
   /usr/include/x86_64-linux-gnu/sys/select.h \
   /usr/include/x86_64-linux-gnu/bits/select.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
+  /usr/include/x86_64-linux-gnu/bits/sigset.h \
+  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/select2.h \
   /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
-  /usr/include/x86_64-linux-gnu/bits/sysmacros.h \
   /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
-  /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
-  /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
   /usr/include/x86_64-linux-gnu/sys/stat.h \
   /usr/include/x86_64-linux-gnu/bits/stat.h \
   /usr/include/x86_64-linux-gnu/sys/mman.h \
   /usr/include/x86_64-linux-gnu/bits/mman.h \
   /usr/include/x86_64-linux-gnu/bits/mman-linux.h \
-  /usr/include/x86_64-linux-gnu/bits/mman-shared.h \
   /usr/include/unistd.h \
   /usr/include/x86_64-linux-gnu/bits/posix_opt.h \
   /usr/include/x86_64-linux-gnu/bits/environments.h \
   /usr/include/x86_64-linux-gnu/bits/confname.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_posix.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_core.h \
+  /usr/include/getopt.h \
   /usr/include/x86_64-linux-gnu/bits/unistd.h \
   /usr/include/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl-linux.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl2.h \
   /usr/include/string.h \
-  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
-  /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
-  /usr/include/strings.h \
-  /usr/include/x86_64-linux-gnu/bits/strings_fortified.h \
-  /usr/include/x86_64-linux-gnu/bits/string_fortified.h \
+  /usr/include/xlocale.h \
+  /usr/include/x86_64-linux-gnu/bits/string.h \
+  /usr/include/x86_64-linux-gnu/bits/string2.h \
   /usr/include/stdlib.h \
+  /usr/include/x86_64-linux-gnu/bits/string3.h \
   /usr/include/x86_64-linux-gnu/bits/waitflags.h \
   /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn-common.h \
   /usr/include/alloca.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib.h \
   /usr/include/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/libio.h \
-  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
-    $(wildcard include/config/h.h) \
-  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \
   /usr/include/x86_64-linux-gnu/bits/stdio2.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/limits.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/syslimits.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
   /usr/include/limits.h \
   /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
   /usr/include/x86_64-linux-gnu/bits/local_lim.h \
@@ -95,9 +75,12 @@ deps_scripts/basic/fixdep := \
   /usr/include/ctype.h \
   /usr/include/arpa/inet.h \
   /usr/include/netinet/in.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h \
+  /usr/include/stdint.h \
+  /usr/include/x86_64-linux-gnu/bits/wchar.h \
   /usr/include/x86_64-linux-gnu/sys/socket.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h \
+  /usr/include/x86_64-linux-gnu/sys/uio.h \
+  /usr/include/x86_64-linux-gnu/bits/uio.h \
   /usr/include/x86_64-linux-gnu/bits/socket.h \
   /usr/include/x86_64-linux-gnu/bits/socket_type.h \
   /usr/include/x86_64-linux-gnu/bits/sockaddr.h \
@@ -105,7 +88,6 @@ deps_scripts/basic/fixdep := \
   /usr/include/asm-generic/socket.h \
   /usr/include/x86_64-linux-gnu/asm/sockios.h \
   /usr/include/asm-generic/sockios.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_osockaddr.h \
   /usr/include/x86_64-linux-gnu/bits/socket2.h \
   /usr/include/x86_64-linux-gnu/bits/in.h \
 

+ 14 - 33
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/scripts/mod/.mk_elfconfig.cmd

@@ -5,23 +5,18 @@ source_scripts/mod/mk_elfconfig := scripts/mod/mk_elfconfig.c
 deps_scripts/mod/mk_elfconfig := \
   /usr/include/stdc-predef.h \
   /usr/include/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
   /usr/include/x86_64-linux-gnu/bits/types.h \
   /usr/include/x86_64-linux-gnu/bits/typesizes.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/libio.h \
-  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
-    $(wildcard include/config/h.h) \
-  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \
@@ -29,46 +24,32 @@ deps_scripts/mod/mk_elfconfig := \
   /usr/include/stdlib.h \
   /usr/include/x86_64-linux-gnu/bits/waitflags.h \
   /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn-common.h \
-  /usr/include/x86_64-linux-gnu/sys/types.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/time_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
   /usr/include/endian.h \
   /usr/include/x86_64-linux-gnu/bits/endian.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
-  /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
+  /usr/include/x86_64-linux-gnu/sys/types.h \
+  /usr/include/time.h \
   /usr/include/x86_64-linux-gnu/sys/select.h \
   /usr/include/x86_64-linux-gnu/bits/select.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
+  /usr/include/x86_64-linux-gnu/bits/sigset.h \
+  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/select2.h \
   /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
-  /usr/include/x86_64-linux-gnu/bits/sysmacros.h \
   /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
-  /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
-  /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
   /usr/include/alloca.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib.h \
   /usr/include/string.h \
-  /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
-  /usr/include/strings.h \
-  /usr/include/x86_64-linux-gnu/bits/strings_fortified.h \
-  /usr/include/x86_64-linux-gnu/bits/string_fortified.h \
+  /usr/include/xlocale.h \
+  /usr/include/x86_64-linux-gnu/bits/string.h \
+  /usr/include/x86_64-linux-gnu/bits/string2.h \
+  /usr/include/x86_64-linux-gnu/bits/string3.h \
   /usr/include/elf.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h \
   /usr/include/stdint.h \
   /usr/include/x86_64-linux-gnu/bits/wchar.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \
   /usr/include/x86_64-linux-gnu/bits/auxv.h \
 
 scripts/mod/mk_elfconfig: $(deps_scripts/mod/mk_elfconfig)

+ 16 - 39
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/usr/.gen_init_cpio.cmd

@@ -5,23 +5,18 @@ source_usr/gen_init_cpio := usr/gen_init_cpio.c
 deps_usr/gen_init_cpio := \
   /usr/include/stdc-predef.h \
   /usr/include/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
   /usr/include/x86_64-linux-gnu/bits/types.h \
   /usr/include/x86_64-linux-gnu/bits/typesizes.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/libio.h \
-  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
-    $(wildcard include/config/h.h) \
-  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \
@@ -29,31 +24,19 @@ deps_usr/gen_init_cpio := \
   /usr/include/stdlib.h \
   /usr/include/x86_64-linux-gnu/bits/waitflags.h \
   /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn-common.h \
-  /usr/include/x86_64-linux-gnu/sys/types.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/time_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
   /usr/include/endian.h \
   /usr/include/x86_64-linux-gnu/bits/endian.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
-  /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
+  /usr/include/x86_64-linux-gnu/sys/types.h \
+  /usr/include/time.h \
   /usr/include/x86_64-linux-gnu/sys/select.h \
   /usr/include/x86_64-linux-gnu/bits/select.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
+  /usr/include/x86_64-linux-gnu/bits/sigset.h \
+  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/select2.h \
   /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
-  /usr/include/x86_64-linux-gnu/bits/sysmacros.h \
   /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
-  /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
-  /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
   /usr/include/alloca.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
@@ -61,22 +44,16 @@ deps_usr/gen_init_cpio := \
   /usr/include/x86_64-linux-gnu/sys/stat.h \
   /usr/include/x86_64-linux-gnu/bits/stat.h \
   /usr/include/string.h \
-  /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
-  /usr/include/strings.h \
-  /usr/include/x86_64-linux-gnu/bits/strings_fortified.h \
-  /usr/include/x86_64-linux-gnu/bits/string_fortified.h \
+  /usr/include/xlocale.h \
+  /usr/include/x86_64-linux-gnu/bits/string.h \
+  /usr/include/x86_64-linux-gnu/bits/string2.h \
+  /usr/include/x86_64-linux-gnu/bits/string3.h \
   /usr/include/unistd.h \
   /usr/include/x86_64-linux-gnu/bits/posix_opt.h \
   /usr/include/x86_64-linux-gnu/bits/environments.h \
   /usr/include/x86_64-linux-gnu/bits/confname.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_posix.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_core.h \
+  /usr/include/getopt.h \
   /usr/include/x86_64-linux-gnu/bits/unistd.h \
-  /usr/include/time.h \
-  /usr/include/x86_64-linux-gnu/bits/time.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \
   /usr/include/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl-linux.h \
@@ -88,8 +65,8 @@ deps_usr/gen_init_cpio := \
   /usr/include/asm-generic/errno.h \
   /usr/include/asm-generic/errno-base.h \
   /usr/include/ctype.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/limits.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/syslimits.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
   /usr/include/limits.h \
   /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
   /usr/include/x86_64-linux-gnu/bits/local_lim.h \

+ 20 - 38
board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/scripts/basic/.fixdep.cmd

@@ -14,81 +14,61 @@ deps_scripts/basic/fixdep := \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
   /usr/include/x86_64-linux-gnu/bits/types.h \
   /usr/include/x86_64-linux-gnu/bits/typesizes.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/time_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
+  /usr/include/time.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
   /usr/include/endian.h \
   /usr/include/x86_64-linux-gnu/bits/endian.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
-  /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
   /usr/include/x86_64-linux-gnu/sys/select.h \
   /usr/include/x86_64-linux-gnu/bits/select.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
+  /usr/include/x86_64-linux-gnu/bits/sigset.h \
+  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/select2.h \
   /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
-  /usr/include/x86_64-linux-gnu/bits/sysmacros.h \
   /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
-  /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
-  /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
   /usr/include/x86_64-linux-gnu/sys/stat.h \
   /usr/include/x86_64-linux-gnu/bits/stat.h \
   /usr/include/x86_64-linux-gnu/sys/mman.h \
   /usr/include/x86_64-linux-gnu/bits/mman.h \
   /usr/include/x86_64-linux-gnu/bits/mman-linux.h \
-  /usr/include/x86_64-linux-gnu/bits/mman-shared.h \
   /usr/include/unistd.h \
   /usr/include/x86_64-linux-gnu/bits/posix_opt.h \
   /usr/include/x86_64-linux-gnu/bits/environments.h \
   /usr/include/x86_64-linux-gnu/bits/confname.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_posix.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_core.h \
+  /usr/include/getopt.h \
   /usr/include/x86_64-linux-gnu/bits/unistd.h \
   /usr/include/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl-linux.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl2.h \
   /usr/include/string.h \
-  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
-  /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
-  /usr/include/strings.h \
-  /usr/include/x86_64-linux-gnu/bits/strings_fortified.h \
-  /usr/include/x86_64-linux-gnu/bits/string_fortified.h \
+  /usr/include/xlocale.h \
+  /usr/include/x86_64-linux-gnu/bits/string.h \
+  /usr/include/x86_64-linux-gnu/bits/string2.h \
   /usr/include/stdlib.h \
+  /usr/include/x86_64-linux-gnu/bits/string3.h \
   /usr/include/x86_64-linux-gnu/bits/waitflags.h \
   /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn-common.h \
   /usr/include/alloca.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib.h \
   /usr/include/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/libio.h \
-  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
-    $(wildcard include/config/h.h) \
-  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \
   /usr/include/x86_64-linux-gnu/bits/stdio2.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/limits.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/syslimits.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
   /usr/include/limits.h \
   /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
   /usr/include/x86_64-linux-gnu/bits/local_lim.h \
@@ -97,9 +77,12 @@ deps_scripts/basic/fixdep := \
   /usr/include/ctype.h \
   /usr/include/arpa/inet.h \
   /usr/include/netinet/in.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h \
+  /usr/include/stdint.h \
+  /usr/include/x86_64-linux-gnu/bits/wchar.h \
   /usr/include/x86_64-linux-gnu/sys/socket.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h \
+  /usr/include/x86_64-linux-gnu/sys/uio.h \
+  /usr/include/x86_64-linux-gnu/bits/uio.h \
   /usr/include/x86_64-linux-gnu/bits/socket.h \
   /usr/include/x86_64-linux-gnu/bits/socket_type.h \
   /usr/include/x86_64-linux-gnu/bits/sockaddr.h \
@@ -107,7 +90,6 @@ deps_scripts/basic/fixdep := \
   /usr/include/asm-generic/socket.h \
   /usr/include/x86_64-linux-gnu/asm/sockios.h \
   /usr/include/asm-generic/sockios.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_osockaddr.h \
   /usr/include/x86_64-linux-gnu/bits/socket2.h \
   /usr/include/x86_64-linux-gnu/bits/in.h \
 

+ 19 - 45
board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/tools/.gen_eth_addr.cmd

@@ -7,21 +7,15 @@ deps_tools/gen_eth_addr := \
   include/libfdt_env.h \
   include/compiler.h \
     $(wildcard include/config/use/stdint.h) \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h \
   /usr/include/stdint.h \
-  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
-  /usr/include/x86_64-linux-gnu/bits/types.h \
-  /usr/include/x86_64-linux-gnu/bits/typesizes.h \
   /usr/include/x86_64-linux-gnu/bits/wchar.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \
   /usr/include/errno.h \
   /usr/include/x86_64-linux-gnu/bits/errno.h \
   /usr/include/linux/errno.h \
@@ -31,69 +25,50 @@ deps_tools/gen_eth_addr := \
   /usr/include/stdlib.h \
   /usr/include/x86_64-linux-gnu/bits/waitflags.h \
   /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn-common.h \
-  /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
-  /usr/include/x86_64-linux-gnu/sys/types.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/time_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \
   /usr/include/endian.h \
   /usr/include/x86_64-linux-gnu/bits/endian.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+  /usr/include/x86_64-linux-gnu/bits/types.h \
+  /usr/include/x86_64-linux-gnu/bits/typesizes.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
-  /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
+  /usr/include/xlocale.h \
+  /usr/include/x86_64-linux-gnu/sys/types.h \
+  /usr/include/time.h \
   /usr/include/x86_64-linux-gnu/sys/select.h \
   /usr/include/x86_64-linux-gnu/bits/select.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
+  /usr/include/x86_64-linux-gnu/bits/sigset.h \
+  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/select2.h \
   /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
-  /usr/include/x86_64-linux-gnu/bits/sysmacros.h \
   /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
-  /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
-  /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
   /usr/include/alloca.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib.h \
   /usr/include/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/libio.h \
-  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
-    $(wildcard include/config/h.h) \
-  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \
   /usr/include/x86_64-linux-gnu/bits/stdio2.h \
   /usr/include/string.h \
-  /usr/include/strings.h \
-  /usr/include/x86_64-linux-gnu/bits/strings_fortified.h \
-  /usr/include/x86_64-linux-gnu/bits/string_fortified.h \
+  /usr/include/x86_64-linux-gnu/bits/string.h \
+  /usr/include/x86_64-linux-gnu/bits/string2.h \
+  /usr/include/x86_64-linux-gnu/bits/string3.h \
   /usr/include/x86_64-linux-gnu/sys/mman.h \
   /usr/include/x86_64-linux-gnu/bits/mman.h \
   /usr/include/x86_64-linux-gnu/bits/mman-linux.h \
-  /usr/include/x86_64-linux-gnu/bits/mman-shared.h \
   /usr/include/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl-linux.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h \
-  /usr/include/linux/falloc.h \
+  /usr/include/x86_64-linux-gnu/bits/uio.h \
   /usr/include/x86_64-linux-gnu/bits/stat.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl2.h \
   /usr/include/byteswap.h \
-  /usr/include/time.h \
-  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/timex.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \
   include/linux/types.h \
     $(wildcard include/config/uid16.h) \
   /usr/include/linux/posix_types.h \
@@ -107,13 +82,12 @@ deps_tools/gen_eth_addr := \
   /usr/include/x86_64-linux-gnu/asm/types.h \
   /usr/include/asm-generic/types.h \
   /usr/include/asm-generic/int-ll64.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdbool.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdbool.h \
   /usr/include/unistd.h \
   /usr/include/x86_64-linux-gnu/bits/posix_opt.h \
   /usr/include/x86_64-linux-gnu/bits/environments.h \
   /usr/include/x86_64-linux-gnu/bits/confname.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_posix.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_core.h \
+  /usr/include/getopt.h \
   /usr/include/x86_64-linux-gnu/bits/unistd.h \
 
 tools/gen_eth_addr: $(deps_tools/gen_eth_addr)

+ 19 - 45
board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/tools/.img2srec.cmd

@@ -7,21 +7,15 @@ deps_tools/img2srec := \
   include/libfdt_env.h \
   include/compiler.h \
     $(wildcard include/config/use/stdint.h) \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h \
   /usr/include/stdint.h \
-  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
-  /usr/include/x86_64-linux-gnu/bits/types.h \
-  /usr/include/x86_64-linux-gnu/bits/typesizes.h \
   /usr/include/x86_64-linux-gnu/bits/wchar.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \
   /usr/include/errno.h \
   /usr/include/x86_64-linux-gnu/bits/errno.h \
   /usr/include/linux/errno.h \
@@ -31,69 +25,50 @@ deps_tools/img2srec := \
   /usr/include/stdlib.h \
   /usr/include/x86_64-linux-gnu/bits/waitflags.h \
   /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn-common.h \
-  /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
-  /usr/include/x86_64-linux-gnu/sys/types.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/time_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \
   /usr/include/endian.h \
   /usr/include/x86_64-linux-gnu/bits/endian.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+  /usr/include/x86_64-linux-gnu/bits/types.h \
+  /usr/include/x86_64-linux-gnu/bits/typesizes.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
-  /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
+  /usr/include/xlocale.h \
+  /usr/include/x86_64-linux-gnu/sys/types.h \
+  /usr/include/time.h \
   /usr/include/x86_64-linux-gnu/sys/select.h \
   /usr/include/x86_64-linux-gnu/bits/select.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
+  /usr/include/x86_64-linux-gnu/bits/sigset.h \
+  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/select2.h \
   /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
-  /usr/include/x86_64-linux-gnu/bits/sysmacros.h \
   /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
-  /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
-  /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
   /usr/include/alloca.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib.h \
   /usr/include/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/libio.h \
-  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
-    $(wildcard include/config/h.h) \
-  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \
   /usr/include/x86_64-linux-gnu/bits/stdio2.h \
   /usr/include/string.h \
-  /usr/include/strings.h \
-  /usr/include/x86_64-linux-gnu/bits/strings_fortified.h \
-  /usr/include/x86_64-linux-gnu/bits/string_fortified.h \
+  /usr/include/x86_64-linux-gnu/bits/string.h \
+  /usr/include/x86_64-linux-gnu/bits/string2.h \
+  /usr/include/x86_64-linux-gnu/bits/string3.h \
   /usr/include/x86_64-linux-gnu/sys/mman.h \
   /usr/include/x86_64-linux-gnu/bits/mman.h \
   /usr/include/x86_64-linux-gnu/bits/mman-linux.h \
-  /usr/include/x86_64-linux-gnu/bits/mman-shared.h \
   /usr/include/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl-linux.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h \
-  /usr/include/linux/falloc.h \
+  /usr/include/x86_64-linux-gnu/bits/uio.h \
   /usr/include/x86_64-linux-gnu/bits/stat.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl2.h \
   /usr/include/byteswap.h \
-  /usr/include/time.h \
-  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/timex.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \
   include/linux/types.h \
     $(wildcard include/config/uid16.h) \
   /usr/include/linux/posix_types.h \
@@ -107,7 +82,7 @@ deps_tools/img2srec := \
   /usr/include/x86_64-linux-gnu/asm/types.h \
   /usr/include/asm-generic/types.h \
   /usr/include/asm-generic/int-ll64.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdbool.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdbool.h \
   tools/os_support.h \
   include/compiler.h \
   /usr/include/ctype.h \
@@ -117,8 +92,7 @@ deps_tools/img2srec := \
   /usr/include/x86_64-linux-gnu/bits/posix_opt.h \
   /usr/include/x86_64-linux-gnu/bits/environments.h \
   /usr/include/x86_64-linux-gnu/bits/confname.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_posix.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_core.h \
+  /usr/include/getopt.h \
   /usr/include/x86_64-linux-gnu/bits/unistd.h \
 
 tools/img2srec: $(deps_tools/img2srec)

+ 23 - 62
board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/tools/.proftool.cmd

@@ -7,21 +7,15 @@ deps_tools/proftool := \
   include/libfdt_env.h \
   include/compiler.h \
     $(wildcard include/config/use/stdint.h) \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h \
   /usr/include/stdint.h \
-  /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \
   /usr/include/features.h \
   /usr/include/x86_64-linux-gnu/sys/cdefs.h \
   /usr/include/x86_64-linux-gnu/bits/wordsize.h \
-  /usr/include/x86_64-linux-gnu/bits/long-double.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs.h \
   /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
-  /usr/include/x86_64-linux-gnu/bits/types.h \
-  /usr/include/x86_64-linux-gnu/bits/typesizes.h \
   /usr/include/x86_64-linux-gnu/bits/wchar.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \
-  /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \
   /usr/include/errno.h \
   /usr/include/x86_64-linux-gnu/bits/errno.h \
   /usr/include/linux/errno.h \
@@ -31,69 +25,50 @@ deps_tools/proftool := \
   /usr/include/stdlib.h \
   /usr/include/x86_64-linux-gnu/bits/waitflags.h \
   /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn.h \
-  /usr/include/x86_64-linux-gnu/bits/floatn-common.h \
-  /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \
-  /usr/include/x86_64-linux-gnu/sys/types.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/time_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \
   /usr/include/endian.h \
   /usr/include/x86_64-linux-gnu/bits/endian.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+  /usr/include/x86_64-linux-gnu/bits/types.h \
+  /usr/include/x86_64-linux-gnu/bits/typesizes.h \
   /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
-  /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \
+  /usr/include/xlocale.h \
+  /usr/include/x86_64-linux-gnu/sys/types.h \
+  /usr/include/time.h \
   /usr/include/x86_64-linux-gnu/sys/select.h \
   /usr/include/x86_64-linux-gnu/bits/select.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \
+  /usr/include/x86_64-linux-gnu/bits/sigset.h \
+  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/select2.h \
   /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
-  /usr/include/x86_64-linux-gnu/bits/sysmacros.h \
   /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \
-  /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \
-  /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \
   /usr/include/alloca.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
   /usr/include/x86_64-linux-gnu/bits/stdlib.h \
   /usr/include/stdio.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/types/FILE.h \
-  /usr/include/x86_64-linux-gnu/bits/libio.h \
-  /usr/include/x86_64-linux-gnu/bits/_G_config.h \
-    $(wildcard include/config/h.h) \
-  /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
+  /usr/include/libio.h \
+  /usr/include/_G_config.h \
+  /usr/include/wchar.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
   /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
   /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
   /usr/include/x86_64-linux-gnu/bits/stdio.h \
   /usr/include/x86_64-linux-gnu/bits/stdio2.h \
   /usr/include/string.h \
-  /usr/include/strings.h \
-  /usr/include/x86_64-linux-gnu/bits/strings_fortified.h \
-  /usr/include/x86_64-linux-gnu/bits/string_fortified.h \
+  /usr/include/x86_64-linux-gnu/bits/string.h \
+  /usr/include/x86_64-linux-gnu/bits/string2.h \
+  /usr/include/x86_64-linux-gnu/bits/string3.h \
   /usr/include/x86_64-linux-gnu/sys/mman.h \
   /usr/include/x86_64-linux-gnu/bits/mman.h \
   /usr/include/x86_64-linux-gnu/bits/mman-linux.h \
-  /usr/include/x86_64-linux-gnu/bits/mman-shared.h \
   /usr/include/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl-linux.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h \
-  /usr/include/linux/falloc.h \
+  /usr/include/x86_64-linux-gnu/bits/uio.h \
   /usr/include/x86_64-linux-gnu/bits/stat.h \
   /usr/include/x86_64-linux-gnu/bits/fcntl2.h \
   /usr/include/byteswap.h \
-  /usr/include/time.h \
-  /usr/include/x86_64-linux-gnu/bits/time.h \
   /usr/include/x86_64-linux-gnu/bits/timex.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \
   include/linux/types.h \
     $(wildcard include/config/uid16.h) \
   /usr/include/linux/posix_types.h \
@@ -107,46 +82,32 @@ deps_tools/proftool := \
   /usr/include/x86_64-linux-gnu/asm/types.h \
   /usr/include/asm-generic/types.h \
   /usr/include/asm-generic/int-ll64.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include/stdbool.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include/stdbool.h \
   /usr/include/assert.h \
   /usr/include/ctype.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/limits.h \
-  /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed/syslimits.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \
+  /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \
   /usr/include/limits.h \
   /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \
   /usr/include/x86_64-linux-gnu/bits/local_lim.h \
   /usr/include/linux/limits.h \
   /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \
   /usr/include/x86_64-linux-gnu/bits/xopen_lim.h \
-  /usr/include/x86_64-linux-gnu/bits/uio_lim.h \
   /usr/include/regex.h \
   /usr/include/unistd.h \
   /usr/include/x86_64-linux-gnu/bits/posix_opt.h \
   /usr/include/x86_64-linux-gnu/bits/environments.h \
   /usr/include/x86_64-linux-gnu/bits/confname.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_posix.h \
-  /usr/include/x86_64-linux-gnu/bits/getopt_core.h \
+  /usr/include/getopt.h \
   /usr/include/x86_64-linux-gnu/bits/unistd.h \
   /usr/include/x86_64-linux-gnu/sys/param.h \
   /usr/include/signal.h \
   /usr/include/x86_64-linux-gnu/bits/signum.h \
-  /usr/include/x86_64-linux-gnu/bits/signum-generic.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sig_atomic_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h \
-  /usr/include/x86_64-linux-gnu/bits/siginfo-arch.h \
-  /usr/include/x86_64-linux-gnu/bits/siginfo-consts.h \
-  /usr/include/x86_64-linux-gnu/bits/siginfo-consts-arch.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sigval_t.h \
-  /usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h \
-  /usr/include/x86_64-linux-gnu/bits/sigevent-consts.h \
+  /usr/include/x86_64-linux-gnu/bits/siginfo.h \
   /usr/include/x86_64-linux-gnu/bits/sigaction.h \
   /usr/include/x86_64-linux-gnu/bits/sigcontext.h \
-  /usr/include/x86_64-linux-gnu/bits/types/stack_t.h \
-  /usr/include/x86_64-linux-gnu/sys/ucontext.h \
   /usr/include/x86_64-linux-gnu/bits/sigstack.h \
-  /usr/include/x86_64-linux-gnu/bits/ss_flags.h \
-  /usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h \
+  /usr/include/x86_64-linux-gnu/sys/ucontext.h \
   /usr/include/x86_64-linux-gnu/bits/sigthread.h \
   /usr/include/x86_64-linux-gnu/bits/param.h \
   /usr/include/linux/param.h \

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików