Просмотр исходного кода

[Improve][Modularization][Module_PowerSharing]
2022.08.15 / Chihhao Hsu

Actions:
1.Fixed some issues with allocating current
2.Added a monitoring mode to instantly watch the status of the current distribution and real-time output (use command #/root/Module_PowerSharing -watch)

-----new added
3.Fixed a problem in conn_update_status() where local variable gun_index in for loop had no initial value

Files:
1.Module_PowerSharing.c

Version: V0.02
Update: 20220815

8408 2 лет назад
Родитель
Сommit
f1c9082a9a
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      EVSE/Modularization/Module_PowerSharing.c

+ 8 - 1
EVSE/Modularization/Module_PowerSharing.c

@@ -15,7 +15,8 @@
 //#define MODPS_FW_DATE		("20220730")
 
 #define MODPS_FW_VER_NUM	(2)    //V/T0.02
-#define MODPS_FW_DATE		("20220812")
+#define MODPS_FW_DATE		("20220815")
+
 
 //-----------------------------------------------------------------------------
 #if (MODPS_FW_VER_NUM >= 1)
@@ -27,7 +28,9 @@
 #define MODIFY_MODPS_LET_ON_HAND_ALL_USED
 #define MODIFY_MODPS_REDUCE_DEBUG_LOG
 #define FUNC_MODPS_WATCH_MODE
+#define FIX_MODPS_CONN_UPDATE_STATUS_LOOP_INDEX_INIT_VAL
 #endif
+//-----------------------------------------------------------------------------
 
 //-----------------------------------------------------------------------------
 
@@ -740,7 +743,11 @@ int conn_update_status(int socketFd, Connector_Info *connectorInfo, uint8_t conn
 		if(ShmPowerSharing->Connection_Info[idx].socketFd == socketFd)
 		{
 			ShmPowerSharing->Connection_Info[idx].connectorCount = connectorCount;
+#ifdef FIX_MODPS_CONN_UPDATE_STATUS_LOOP_INDEX_INIT_VAL
+			for(uint8_t gun_index=0;gun_index<connectorCount;gun_index++)
+#else
 			for(uint8_t gun_index;gun_index<connectorCount;gun_index++)
+#endif
 			{
 				if(!ShmPowerSharing->Connection_Info[idx].connectorInfo[gun_index].isGunConnected && connectorInfo[gun_index].isGunConnected)
 				{