|
@@ -384,10 +384,11 @@ int conn_update_status(int socketFd, uint8_t pilotState, uint8_t availableCurren
|
|
|
(ShmPowerSharing->Connection_Info[idx].presentOutputCurrent != presentCurrent) ||
|
|
|
(ShmPowerSharing->Connection_Info[idx].acPhase != acPhase))
|
|
|
{
|
|
|
- DEBUG_INFO("Connection-%d pilot state: %d \n", idx, pilotState);
|
|
|
- DEBUG_INFO("Connection-%d available current: %d \n", idx, availableCurrent);
|
|
|
- DEBUG_INFO("Connection-%d preset output current: %d \n", idx, presentCurrent);
|
|
|
- DEBUG_INFO("Connection-%d ac power phase: %d \n", idx, acPhase);
|
|
|
+ DEBUG_INFO("Conn-%d pilot state: %d\n", idx, pilotState);
|
|
|
+ DEBUG_INFO("Conn-%d available current: %d\n", idx, availableCurrent);
|
|
|
+ DEBUG_INFO("Conn-%d preset output current: %d\n", idx, presentCurrent);
|
|
|
+ DEBUG_INFO("Conn-%d ac power phase: %d\n", idx, acPhase);
|
|
|
+ DEBUG_INFO("==================================\n");
|
|
|
}
|
|
|
|
|
|
ShmPowerSharing->Connection_Info[idx].isGunConnected = (2<=pilotState)&&(pilotState<=7)?YES:NO;
|
|
@@ -414,7 +415,7 @@ int conn_getOnHandCurrent(void)
|
|
|
|
|
|
result = ShmCharger->gun_info[0].primaryMcuState.rating_current - result;
|
|
|
|
|
|
- DEBUG_INFO("Total on hand available current: %d\n", result);
|
|
|
+ DEBUG_INFO("Total available current: %d\n", result);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -751,7 +752,7 @@ int balance_check_loop(void)
|
|
|
// Check available power
|
|
|
if(ShmPowerSharing->hasNewConn)
|
|
|
{
|
|
|
- DEBUG_INFO("New connection gun connected and re-allocate available current to each connection.\n");
|
|
|
+ DEBUG_INFO("Detect gun connected re-allocate available current to each connection.\n");
|
|
|
|
|
|
for(uint8_t idx=0;idx<CONNECTION_LIMIT;idx++)
|
|
|
{
|
|
@@ -783,7 +784,7 @@ int balance_check_loop(void)
|
|
|
}
|
|
|
else if(((ShmPowerSharing->Connection_Info[idx].presentOutputCurrent-1) < ShmPowerSharing->Connection_Info[idx].availableSharingCurrent) &&
|
|
|
(ShmPowerSharing->Connection_Info[idx].availableSharingCurrent < (ShmPowerSharing->Connection_Info[idx].presentOutputCurrent+1)) &&
|
|
|
- (conn_getOnHandCurrent() > 2))
|
|
|
+ (conn_getOnHandCurrent() >= 2))
|
|
|
{
|
|
|
ShmPowerSharing->Connection_Info[idx].availableSharingCurrent += 2;
|
|
|
}
|