|
@@ -1927,6 +1927,415 @@ int main(void)
|
|
|
DEBUG_INFO("ttyS1 port open success.\n");
|
|
|
}
|
|
|
|
|
|
+ if(fork() == 0)
|
|
|
+ {
|
|
|
+ for(;;)
|
|
|
+ {
|
|
|
+ for(int gun_index=0;gun_index<AC_QUANTITY;gun_index++)
|
|
|
+ {
|
|
|
+ //==========================================================
|
|
|
+ // High priority polling log print out
|
|
|
+ //==========================================================
|
|
|
+ //==================================================
|
|
|
+ // Case 1: Config primary MCU LED
|
|
|
+ //==================================================
|
|
|
+ if((previousCharger.gun_info[gun_index].primaryMcuLed.mode != ShmCharger->gun_info[gun_index].primaryMcuLed.mode) ||
|
|
|
+ (previousCharger.gun_info[gun_index].primaryMcuLed.alarm_code != ShmCharger->gun_info[gun_index].primaryMcuLed.alarm_code))
|
|
|
+ {
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("***** High priority polling : Case 1 ******\n");
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("MCU-%d set Led mode : %d\n",gun_index, ShmCharger->gun_info[gun_index].primaryMcuLed.mode);
|
|
|
+ DEBUG_INFO("MCU-%d set Alarm code : %x\n",gun_index, ShmCharger->gun_info[gun_index].primaryMcuLed.alarm_code);
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].primaryMcuLed.mode = ShmCharger->gun_info[gun_index].primaryMcuLed.mode;
|
|
|
+ previousCharger.gun_info[gun_index].primaryMcuLed.alarm_code = ShmCharger->gun_info[gun_index].primaryMcuLed.alarm_code;
|
|
|
+ }
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 2: Config primary Legacy request
|
|
|
+ //==================================================
|
|
|
+ if(previousCharger.gun_info[gun_index].legacyRequest.isLegacyRequest != ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("***** High priority polling : Case 2 ******\n");
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("MCU-%d set relay request : %d\n", gun_index, ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest);
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].legacyRequest.isLegacyRequest = ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest;
|
|
|
+ }
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 3: Query primary MCU status
|
|
|
+ //==================================================
|
|
|
+ if((previousCharger.gun_info[gun_index].primaryMcuState.cp_state != ShmCharger->gun_info[gun_index].primaryMcuState.cp_state) ||
|
|
|
+ (previousCharger.gun_info[gun_index].primaryMcuState.current_limit != ShmCharger->gun_info[gun_index].primaryMcuState.current_limit) ||
|
|
|
+ (previousCharger.gun_info[gun_index].primaryMcuState.relay_state != ShmCharger->gun_info[gun_index].primaryMcuState.relay_state) ||
|
|
|
+ (previousCharger.gun_info[gun_index].primaryMcuState.rotatory_switch != ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch) ||
|
|
|
+ (previousCharger.gun_info[gun_index].primaryMcuState.socket_e.isSocketEMode != ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEMode) ||
|
|
|
+ (previousCharger.gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn != ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn))
|
|
|
+ {
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("***** High priority polling : Case 3 ******\n");
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("MCU-%d get Pilot State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.cp_state);
|
|
|
+ DEBUG_INFO("MCU-%d get Pilot Duty : %.2f\n", gun_index, (float)ShmCharger->gun_info[gun_index].primaryMcuState.current_limit);
|
|
|
+ DEBUG_INFO("MCU-%d get Pilot Voltage Positive : %.2f\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.cp_voltage_positive);
|
|
|
+ DEBUG_INFO("MCU-%d get Pilot Voltage Negative : %.2f\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.cp_voltage_negtive);
|
|
|
+
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuState.relay_state == ON)
|
|
|
+ {
|
|
|
+ if(ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn == ON)
|
|
|
+ DEBUG_INFO("Relay on mode : CHARGING_MODE_SOCKETE. \n");
|
|
|
+ else
|
|
|
+ DEBUG_INFO("Relay on mode : CHARGING_MODE_BS / CHARGING_MODE_HLC. \n");
|
|
|
+ }
|
|
|
+
|
|
|
+ DEBUG_INFO("MCU-%d get Relay State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.relay_state);
|
|
|
+ DEBUG_INFO("MCU-%d get Rating Current : %.2f\n", gun_index, (float)ShmCharger->gun_info[gun_index].primaryMcuState.rating_current);
|
|
|
+ DEBUG_INFO("MCU-%d get Rotary switch : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch);
|
|
|
+ DEBUG_INFO("MCU-%d get is on Socket-E mode : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEMode);
|
|
|
+ DEBUG_INFO("MCU-%d get Socket-E detect pin : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn);
|
|
|
+ DEBUG_INFO("MCU-%d get Locker State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.locker_state);
|
|
|
+ DEBUG_INFO("MCU-%d get Shutter State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.shutter_state);
|
|
|
+ DEBUG_INFO("MCU-%d get Meter State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.meter_state);
|
|
|
+ DEBUG_INFO("MCU-%d get PP State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.pp_state);
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].primaryMcuState.cp_state = ShmCharger->gun_info[gun_index].primaryMcuState.cp_state;
|
|
|
+ previousCharger.gun_info[gun_index].primaryMcuState.current_limit = ShmCharger->gun_info[gun_index].primaryMcuState.current_limit;
|
|
|
+ previousCharger.gun_info[gun_index].primaryMcuState.rotatory_switch = ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch;
|
|
|
+ previousCharger.gun_info[gun_index].primaryMcuState.relay_state = ShmCharger->gun_info[gun_index].primaryMcuState.relay_state;
|
|
|
+ previousCharger.gun_info[gun_index].primaryMcuState.socket_e.isSocketEMode = ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEMode;
|
|
|
+ previousCharger.gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn = ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn;
|
|
|
+ }
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 4: Query primary MCU Alarm code
|
|
|
+ //==================================================
|
|
|
+ if((previousCharger.gun_info[gun_index].primaryMcuAlarm.InputAlarmCode != ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode))
|
|
|
+ {
|
|
|
+ if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode>0))
|
|
|
+ {
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("***** High priority polling : Case 4 ******\n");
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("MCU-%d get OVP_L1 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OVP_L1);
|
|
|
+ DEBUG_INFO("MCU-%d get UVP_L1 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.UVP_L1);
|
|
|
+ DEBUG_INFO("MCU-%d get OCP_L1 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L1);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("MCU-%d get OVP_L2 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OVP_L2);
|
|
|
+ DEBUG_INFO("MCU-%d get UVP_L2 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.UVP_L2);
|
|
|
+ DEBUG_INFO("MCU-%d get OCP_L2 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L2);
|
|
|
+ DEBUG_INFO("MCU-%d get OVP_L3 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OVP_L3);
|
|
|
+ DEBUG_INFO("MCU-%d get UVP_L3 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.UVP_L3);
|
|
|
+ DEBUG_INFO("MCU-%d get OCP_L3 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L3);
|
|
|
+ }
|
|
|
+ DEBUG_INFO("MCU-%d get OTP : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OTP);
|
|
|
+ DEBUG_INFO("MCU-%d get gmi_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.gmi_fault);
|
|
|
+ DEBUG_INFO("MCU-%d get cp_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.cp_fault);
|
|
|
+ DEBUG_INFO("MCU-%d get ac_leak : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.ac_leak);
|
|
|
+ DEBUG_INFO("MCU-%d get dc_leak : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.dc_leak);
|
|
|
+ DEBUG_INFO("MCU-%d get mcu_selftest_fail : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.mcu_selftest_fail);
|
|
|
+ DEBUG_INFO("MCU-%d get handshaking_timeout : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.handshaking_timeout);
|
|
|
+ DEBUG_INFO("MCU-%d get emergency_stop : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.emergency_stop);
|
|
|
+ DEBUG_INFO("MCU-%d get relay_welding : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.relay_welding);
|
|
|
+ DEBUG_INFO("MCU-%d get leak_module_fail : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.leak_module_fail);
|
|
|
+ DEBUG_INFO("MCU-%d get shutter_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.shutter_fault);
|
|
|
+ DEBUG_INFO("MCU-%d get locker_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.locker_fault);
|
|
|
+ DEBUG_INFO("MCU-%d get power_drop : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.power_drop);
|
|
|
+ DEBUG_INFO("MCU-%d get rotate_switch_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.rotate_switch_fault);
|
|
|
+ DEBUG_INFO("MCU-%d get short_circuit_L1 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.short_circuit_L1);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("MCU-%d get short_circuit_L2 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.short_circuit_L2);
|
|
|
+ DEBUG_INFO("MCU-%d get short_circuit_L3 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.short_circuit_L3);
|
|
|
+ }
|
|
|
+ DEBUG_INFO("MCU-%d get relay_drive_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.relay_drive_fault);
|
|
|
+ DEBUG_INFO("MCU-%d get meter_comm_timeout : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.meter_comm_timeout);
|
|
|
+ DEBUG_INFO("MCU-%d get meter_ic_comm_timeout : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.meter_ic_comm_timeout);
|
|
|
+ DEBUG_INFO("MCU-%d get pilot_negative_error : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.pilot_negative_error);
|
|
|
+ DEBUG_INFO("MCU-%d get InputAlarmCode : %x\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode);
|
|
|
+ }
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].primaryMcuAlarm.InputAlarmCode = ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 5: Query primary MCU BLE config
|
|
|
+ //==================================================
|
|
|
+ /*
|
|
|
+ if((previousCharger.gun_info[gun_index].bleConfigData.isLogin != ShmCharger->gun_info[gun_index].bleConfigData.isLogin) ||
|
|
|
+ (previousCharger.gun_info[gun_index].bleConfigData.isRequestStart != ShmCharger->gun_info[gun_index].bleConfigData.isRequestStart) ||
|
|
|
+ (previousCharger.gun_info[gun_index].bleConfigData.isRequestStop != ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop))
|
|
|
+ {
|
|
|
+ if(ShmCharger->gun_info[gun_index].bleConfigData.isLogin == ON)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("***** High priority polling : Case 5 ******\n");
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("MCU-%d get isUserLogin : %d\n", gun_index, ShmCharger->gun_info[gun_index].bleConfigData.isLogin);
|
|
|
+ DEBUG_INFO("MCU-%d get isRequestStartCharger : %d\n", gun_index, ShmCharger->gun_info[gun_index].bleConfigData.isRequestStart);
|
|
|
+ DEBUG_INFO("MCU-%d get isRequestStopCharger : %d\n", gun_index, ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop);
|
|
|
+ }
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].bleConfigData.isLogin = ShmCharger->gun_info[gun_index].bleConfigData.isLogin;
|
|
|
+ previousCharger.gun_info[gun_index].bleConfigData.isRequestStart = ShmCharger->gun_info[gun_index].bleConfigData.isRequestStart;
|
|
|
+ previousCharger.gun_info[gun_index].bleConfigData.isRequestStop = ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop;
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 6: Query primary MCU ble login id
|
|
|
+ //==================================================
|
|
|
+ /*
|
|
|
+ if((strcmp((char *)&previousCharger.gun_info[gun_index].bleLoginCentralId.id,(char *)&ShmCharger->gun_info[gun_index].bleLoginCentralId.id) != 0))
|
|
|
+ {
|
|
|
+ if(strcmp((char *)&ShmCharger->gun_info[gun_index].bleLoginCentralId.id,"") != 0)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("***** High priority polling : Case 6 ******\n");
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("MCU-%d get ble central id : %s\n", gun_index, ShmCharger->gun_info[gun_index].bleLoginCentralId.id);
|
|
|
+ }
|
|
|
+
|
|
|
+ memcpy(&previousCharger.gun_info[gun_index].bleLoginCentralId.id, ShmCharger->gun_info[gun_index].bleLoginCentralId.id, ARRAY_SIZE(ShmCharger->gun_info[gun_index].bleLoginCentralId.id));
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 8: Config primary MCU duty
|
|
|
+ //==================================================
|
|
|
+ if(previousCharger.gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current != ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("***** High priority polling : Case 8 ******\n");
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("MCU-%d set cp pwn duty : %d\n",gun_index, ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current);
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current;
|
|
|
+ }
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 10: Query primary MCU power consumption
|
|
|
+ //==================================================
|
|
|
+ if((previousCharger.gun_info[gun_index].powerConsumptionTotal.power_consumption != ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption) ||
|
|
|
+ (previousCharger.gun_info[gun_index].powerConsumption[0].power_consumption != ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption) ||
|
|
|
+ (previousCharger.gun_info[gun_index].powerConsumption[1].power_consumption != ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption) ||
|
|
|
+ (previousCharger.gun_info[gun_index].powerConsumption[2].power_consumption != ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption))
|
|
|
+ {
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("***** High priority polling : Case 10 *****\n");
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("MCU-%d get total power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0));
|
|
|
+ DEBUG_INFO("MCU-%d get L1N_L12 power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption/10000.0));
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("MCU-%d get L2N_L23 power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption/10000.0));
|
|
|
+ DEBUG_INFO("MCU-%d get L3N_L31 power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption/10000.0));
|
|
|
+ }
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].powerConsumptionTotal.power_consumption = ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption;
|
|
|
+ previousCharger.gun_info[gun_index].powerConsumption[0].power_consumption = ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption;
|
|
|
+ previousCharger.gun_info[gun_index].powerConsumption[1].power_consumption = ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption;
|
|
|
+ previousCharger.gun_info[gun_index].powerConsumption[2].power_consumption = ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption;
|
|
|
+ }
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 11: Query primary Out put current config
|
|
|
+ //==================================================
|
|
|
+ if((previousCharger.gun_info[gun_index].outputCurrent.L1N_L12[0] != ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]) ||
|
|
|
+ (previousCharger.gun_info[gun_index].outputCurrent.L2N_L23[0] != ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0]) ||
|
|
|
+ (previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] != ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0]))
|
|
|
+ {
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("***** High priority polling : Case 11 *****\n");
|
|
|
+ DEBUG_INFO("*******************************************\n");
|
|
|
+ DEBUG_INFO("MCU-%d get output current L1: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("MCU-%d get output current L2: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0]);
|
|
|
+ DEBUG_INFO("MCU-%d get output current L3: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0]);
|
|
|
+ }
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].outputCurrent.L1N_L12[0] = ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];
|
|
|
+ previousCharger.gun_info[gun_index].outputCurrent.L2N_L23[0] = ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0];
|
|
|
+ previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] = ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0];
|
|
|
+ }
|
|
|
+
|
|
|
+ //==========================================================
|
|
|
+ // Low priority polling log print out
|
|
|
+ //==========================================================
|
|
|
+ //==================================================
|
|
|
+ // Case 1: Query primary In put voltage
|
|
|
+ //==================================================
|
|
|
+ if((previousCharger.gun_info[gun_index].inputVoltage.L1N_L12 != ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12) ||
|
|
|
+ (previousCharger.gun_info[gun_index].inputVoltage.L2N_L23 != ShmCharger->gun_info[gun_index].inputVoltage.L2N_L23) ||
|
|
|
+ (previousCharger.gun_info[gun_index].inputVoltage.L3N_L31 != ShmCharger->gun_info[gun_index].inputVoltage.L3N_L31))
|
|
|
+ {
|
|
|
+ DEBUG_INFO("===========================================\n");
|
|
|
+ DEBUG_INFO("==== Normal priority polling : Case 1 =====\n");
|
|
|
+ DEBUG_INFO("===========================================\n");
|
|
|
+ DEBUG_INFO("MCU-%d get Input voltage L1: %.2f\n", gun_index, (float)ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12);
|
|
|
+ DEBUG_INFO("MCU-%d get PresentChargingVoltage L1: %.2f\n", gun_index, (float)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltage);
|
|
|
+
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("MCU-%d get Input voltage L2: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].inputVoltage.L2N_L23);
|
|
|
+ DEBUG_INFO("MCU-%d get PresentChargingVoltage L2: %.2f\n", gun_index, (float)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltageL2);
|
|
|
+ DEBUG_INFO("MCU-%d get Input voltage L3: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].inputVoltage.L3N_L31);
|
|
|
+ DEBUG_INFO("MCU-%d get PresentChargingVoltage L3: %.2f\n", gun_index, (float)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltageL3);
|
|
|
+ }
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].inputVoltage.L1N_L12 = ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12;
|
|
|
+ previousCharger.gun_info[gun_index].inputVoltage.L2N_L23 = ShmCharger->gun_info[gun_index].inputVoltage.L2N_L23;
|
|
|
+ previousCharger.gun_info[gun_index].inputVoltage.L3N_L31 = ShmCharger->gun_info[gun_index].inputVoltage.L3N_L31;
|
|
|
+ }
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 5: Query primary plug in times
|
|
|
+ //==================================================
|
|
|
+ if(previousCharger.gun_info[gun_index].gunPluginTimes.GunPluginTimes != ShmCharger->gun_info[gun_index].gunPluginTimes.GunPluginTimes)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("===========================================\n");
|
|
|
+ DEBUG_INFO("==== Normal priority polling : Case 5 =====\n");
|
|
|
+ DEBUG_INFO("===========================================\n");
|
|
|
+ DEBUG_INFO("MCU-%d get gun plugin times : %ld\n", gun_index, (long)ShmCharger->gun_info[gun_index].gunPluginTimes.GunPluginTimes);
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].gunPluginTimes.GunPluginTimes = ShmCharger->gun_info[gun_index].gunPluginTimes.GunPluginTimes;
|
|
|
+ }
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 7: Query primary temperature
|
|
|
+ //==================================================
|
|
|
+ if(previousCharger.gun_info[gun_index].temperature.point[0] != ShmCharger->gun_info[gun_index].temperature.point[0])
|
|
|
+ {
|
|
|
+ DEBUG_INFO("===========================================\n");
|
|
|
+ DEBUG_INFO("==== Normal priority polling : Case 7 =====\n");
|
|
|
+ DEBUG_INFO("===========================================\n");
|
|
|
+ DEBUG_INFO("MCU-%d get temperature : %d\n", gun_index, ShmCharger->gun_info[gun_index].temperature.point[0]);
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].temperature.point[0] = ShmCharger->gun_info[gun_index].temperature.point[0];
|
|
|
+ }
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 11: Config primary RTC time
|
|
|
+ //==================================================
|
|
|
+ if(previousCharger.gun_info[gun_index].rtc.min != ShmCharger->gun_info[gun_index].rtc.min)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("===========================================\n");
|
|
|
+ DEBUG_INFO("==== Normal priority polling : Case 11 ====\n");
|
|
|
+ DEBUG_INFO("===========================================\n");
|
|
|
+ if(ShmCharger->gun_info[gun_index].bleConfigData.isLogin && !ShmOCPP16Data->OcppConnStatus)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("Sync from MCU-%d rtc OK...%04d-%02d-%02d %02d:%02d:%02d\n", gun_index,
|
|
|
+ ShmCharger->gun_info[gun_index].rtc.year,
|
|
|
+ ShmCharger->gun_info[gun_index].rtc.month,
|
|
|
+ ShmCharger->gun_info[gun_index].rtc.day,
|
|
|
+ ShmCharger->gun_info[gun_index].rtc.hour,
|
|
|
+ ShmCharger->gun_info[gun_index].rtc.min,
|
|
|
+ ShmCharger->gun_info[gun_index].rtc.sec);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ DEBUG_INFO("MCU-%d set rtc OK...%04d-%02d-%02d %02d:%02d:%02d\n", gun_index,
|
|
|
+ ShmCharger->gun_info[gun_index].rtc.year,
|
|
|
+ ShmCharger->gun_info[gun_index].rtc.month,
|
|
|
+ ShmCharger->gun_info[gun_index].rtc.day,
|
|
|
+ ShmCharger->gun_info[gun_index].rtc.hour,
|
|
|
+ ShmCharger->gun_info[gun_index].rtc.min,
|
|
|
+ ShmCharger->gun_info[gun_index].rtc.sec);
|
|
|
+ }
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].rtc.min = ShmCharger->gun_info[gun_index].rtc.min;
|
|
|
+ }
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 15: Config led breathe timing
|
|
|
+ //==================================================
|
|
|
+ if((previousCharger.gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_In != ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_In) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_Out != ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_Out) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setBreatheLedTiming.Set_Led_Action_Chaging_Fade_In != ShmCharger->gun_info[gun_index].setBreatheLedTiming.Set_Led_Action_Chaging_Fade_In) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Chaging_Fade_Out != ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Chaging_Fade_Out) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_In != ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_In) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_Out != ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_Out))
|
|
|
+ {
|
|
|
+ if(ShmCharger->gun_info[gun_index].isSetBreatheLedTiming == ON)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("===========================================\n");
|
|
|
+ DEBUG_INFO("==== Normal priority polling : Case 15 ====\n");
|
|
|
+ DEBUG_INFO("===========================================\n");
|
|
|
+ DEBUG_INFO("MCU-%d set breathe led timing : Authed Fade in [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_In);
|
|
|
+ DEBUG_INFO("MCU-%d set breathe led timing : Authed Fade out [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_Out);
|
|
|
+ DEBUG_INFO("MCU-%d set breathe led timing : Charging Fade in [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.Set_Led_Action_Chaging_Fade_In);
|
|
|
+ DEBUG_INFO("MCU-%d set breathe led timing : Charging Fade out [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Chaging_Fade_Out);
|
|
|
+ DEBUG_INFO("MCU-%d set breathe led timing : Connected Fade in [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_In);
|
|
|
+ DEBUG_INFO("MCU-%d set breathe led timing : Connected Fade out [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_Out);
|
|
|
+ }
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_In = ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_In;
|
|
|
+ previousCharger.gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_Out = ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_Out;
|
|
|
+ previousCharger.gun_info[gun_index].setBreatheLedTiming.Set_Led_Action_Chaging_Fade_In = ShmCharger->gun_info[gun_index].setBreatheLedTiming.Set_Led_Action_Chaging_Fade_In;
|
|
|
+ previousCharger.gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Chaging_Fade_Out = ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Chaging_Fade_Out;
|
|
|
+ previousCharger.gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_In = ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_In;
|
|
|
+ previousCharger.gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_Out = ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_Out;
|
|
|
+ }
|
|
|
+
|
|
|
+ //==================================================
|
|
|
+ // Case 17: Config led brightness
|
|
|
+ //==================================================
|
|
|
+ if((previousCharger.gun_info[gun_index].setLedBrightness.sector_1 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_1) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setLedBrightness.sector_2 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_2) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setLedBrightness.sector_3 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_3) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setLedBrightness.sector_4 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_4) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setLedBrightness.sector_5 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_5) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setLedBrightness.sector_6 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_6) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setLedBrightness.sector_7 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_7) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setLedBrightness.sector_8 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_8) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setLedBrightness.sector_9 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_9) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setLedBrightness.sector_10 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_10) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setLedBrightness.sector_11 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_11) ||
|
|
|
+ (previousCharger.gun_info[gun_index].setLedBrightness.sector_12 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_12))
|
|
|
+ {
|
|
|
+ if(ShmCharger->gun_info[gun_index].isSetLedBrightness == ON)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("===========================================\n");
|
|
|
+ DEBUG_INFO("==== Normal priority polling : Case 17 ====\n");
|
|
|
+ DEBUG_INFO("===========================================\n");
|
|
|
+ DEBUG_INFO("MCU-%d set led brightness Sector 01 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_1);
|
|
|
+ DEBUG_INFO("MCU-%d set led brightness Sector 02 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_2);
|
|
|
+ DEBUG_INFO("MCU-%d set led brightness Sector 03 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_3);
|
|
|
+ DEBUG_INFO("MCU-%d set led brightness Sector 04 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_4);
|
|
|
+ DEBUG_INFO("MCU-%d set led brightness Sector 05 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_5);
|
|
|
+ DEBUG_INFO("MCU-%d set led brightness Sector 06 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_6);
|
|
|
+ DEBUG_INFO("MCU-%d set led brightness Sector 07 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_7);
|
|
|
+ DEBUG_INFO("MCU-%d set led brightness Sector 08 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_8);
|
|
|
+ DEBUG_INFO("MCU-%d set led brightness Sector 09 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_9);
|
|
|
+ DEBUG_INFO("MCU-%d set led brightness Sector 10 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_10);
|
|
|
+ DEBUG_INFO("MCU-%d set led brightness Sector 11 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_11);
|
|
|
+ DEBUG_INFO("MCU-%d set led brightness Sector 12 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_12);
|
|
|
+ }
|
|
|
+
|
|
|
+ previousCharger.gun_info[gun_index].setLedBrightness.sector_1 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_1;
|
|
|
+ previousCharger.gun_info[gun_index].setLedBrightness.sector_2 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_2;
|
|
|
+ previousCharger.gun_info[gun_index].setLedBrightness.sector_3 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_3;
|
|
|
+ previousCharger.gun_info[gun_index].setLedBrightness.sector_4 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_4;
|
|
|
+ previousCharger.gun_info[gun_index].setLedBrightness.sector_5 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_5;
|
|
|
+ previousCharger.gun_info[gun_index].setLedBrightness.sector_6 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_6;
|
|
|
+ previousCharger.gun_info[gun_index].setLedBrightness.sector_7 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_7;
|
|
|
+ previousCharger.gun_info[gun_index].setLedBrightness.sector_8 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_8;
|
|
|
+ previousCharger.gun_info[gun_index].setLedBrightness.sector_9 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_9;
|
|
|
+ previousCharger.gun_info[gun_index].setLedBrightness.sector_10 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_10;
|
|
|
+ previousCharger.gun_info[gun_index].setLedBrightness.sector_11 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_11;
|
|
|
+ previousCharger.gun_info[gun_index].setLedBrightness.sector_12 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_12;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ usleep(100000);
|
|
|
+ }
|
|
|
+
|
|
|
+ exit(0);
|
|
|
+ }
|
|
|
+
|
|
|
for(;;)
|
|
|
{
|
|
|
for(int gun_index=0;gun_index<AC_QUANTITY;gun_index++)
|
|
@@ -2161,7 +2570,7 @@ int main(void)
|
|
|
//===============================
|
|
|
if(ShmCharger->gun_info[gun_index].mcuFlag.isSetCpPwmDuty == ON)
|
|
|
{
|
|
|
- DEBUG_WARN("Case 8 : Config primary set CP PWN duty...%d\n", ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty);
|
|
|
+ //DEBUG_WARN("Case 8 : Config primary set CP PWN duty...%d\n", ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty);
|
|
|
if(Config_AC_MaxCurrent_And_CpPwmDuty(Uart1Fd, (gun_index>0?ADDR_AC_PRIMARY_2:ADDR_AC_PRIMARY_1), &ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty))
|
|
|
{
|
|
|
failCount[gun_index] = 0;
|
|
@@ -2241,227 +2650,6 @@ int main(void)
|
|
|
else
|
|
|
failCount[gun_index] = FAIL_SPEC_COMM;
|
|
|
}
|
|
|
-
|
|
|
- //==========================================================
|
|
|
- // High priority polling log print out
|
|
|
- //==========================================================
|
|
|
- if((current_timestamp() - tsPrintLog[PRIORITY_HIGH]) > (ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest?3000:6000))
|
|
|
- {
|
|
|
- tsPrintLog[PRIORITY_HIGH] = current_timestamp();
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Config primary MCU LED
|
|
|
- //===============================
|
|
|
- if((previousCharger.gun_info[gun_index].primaryMcuLed.mode != ShmCharger->gun_info[gun_index].primaryMcuLed.mode) ||
|
|
|
- (previousCharger.gun_info[gun_index].primaryMcuLed.alarm_code != ShmCharger->gun_info[gun_index].primaryMcuLed.alarm_code))
|
|
|
- {
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("***** High priority polling : Case 1 ******\n");
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("MCU-%d set Led mode : %d\n",gun_index, ShmCharger->gun_info[gun_index].primaryMcuLed.mode);
|
|
|
- DEBUG_INFO("MCU-%d set Alarm code : %x\n",gun_index, ShmCharger->gun_info[gun_index].primaryMcuLed.alarm_code);
|
|
|
-
|
|
|
- previousCharger.gun_info[gun_index].primaryMcuLed.mode = ShmCharger->gun_info[gun_index].primaryMcuLed.mode;
|
|
|
- previousCharger.gun_info[gun_index].primaryMcuLed.alarm_code = ShmCharger->gun_info[gun_index].primaryMcuLed.alarm_code;
|
|
|
- }
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Config primary Legacy request
|
|
|
- //===============================
|
|
|
- if(previousCharger.gun_info[gun_index].legacyRequest.isLegacyRequest != ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest)
|
|
|
- {
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("***** High priority polling : Case 2 ******\n");
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("MCU-%d set relay request : %d\n", gun_index, ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest);
|
|
|
-
|
|
|
- previousCharger.gun_info[gun_index].legacyRequest.isLegacyRequest = ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest;
|
|
|
- }
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Query primary MCU status
|
|
|
- //===============================
|
|
|
- if((previousCharger.gun_info[gun_index].primaryMcuState.cp_state != ShmCharger->gun_info[gun_index].primaryMcuState.cp_state) ||
|
|
|
- (previousCharger.gun_info[gun_index].primaryMcuState.current_limit != ShmCharger->gun_info[gun_index].primaryMcuState.current_limit) ||
|
|
|
- (previousCharger.gun_info[gun_index].primaryMcuState.relay_state != ShmCharger->gun_info[gun_index].primaryMcuState.relay_state) ||
|
|
|
- (previousCharger.gun_info[gun_index].primaryMcuState.socket_e.isSocketEMode != ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEMode) ||
|
|
|
- (previousCharger.gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn != ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn))
|
|
|
- {
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("***** High priority polling : Case 3 ******\n");
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("MCU-%d get Pilot State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.cp_state);
|
|
|
- DEBUG_INFO("MCU-%d get Pilot Duty : %.2f\n", gun_index, (float)ShmCharger->gun_info[gun_index].primaryMcuState.current_limit);
|
|
|
- DEBUG_INFO("MCU-%d get Pilot Voltage Positive : %.2f\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.cp_voltage_positive);
|
|
|
- DEBUG_INFO("MCU-%d get Pilot Voltage Negative : %.2f\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.cp_voltage_negtive);
|
|
|
-
|
|
|
- if(ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn == ON)
|
|
|
- DEBUG_INFO("Relay on mode : CHARGING_MODE_SOCKETE. \n");
|
|
|
- else
|
|
|
- DEBUG_INFO("Relay on mode : CHARGING_MODE_BS / CHARGING_MODE_HLC. \n");
|
|
|
-
|
|
|
- DEBUG_INFO("MCU-%d get Relay State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.relay_state);
|
|
|
- DEBUG_INFO("MCU-%d get Rating Current : %.2f\n", gun_index, (float)ShmCharger->gun_info[gun_index].primaryMcuState.rating_current);
|
|
|
- DEBUG_INFO("MCU-%d get Rotary switch : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch);
|
|
|
- DEBUG_INFO("MCU-%d get is on Socket-E mode : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEMode);
|
|
|
- DEBUG_INFO("MCU-%d get Socket-E detect pin : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn);
|
|
|
- DEBUG_INFO("MCU-%d get Locker State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.locker_state);
|
|
|
- DEBUG_INFO("MCU-%d get Shutter State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.shutter_state);
|
|
|
- DEBUG_INFO("MCU-%d get Meter State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.meter_state);
|
|
|
- DEBUG_INFO("MCU-%d get PP State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.pp_state);
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Query primary MCU power consumption
|
|
|
- //===============================
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("***** High priority polling : Case 10 *****\n");
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("MCU-%d get total power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0));
|
|
|
- DEBUG_INFO("MCU-%d get L1N_L12 power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption/10000.0));
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
- {
|
|
|
- DEBUG_INFO("MCU-%d get L2N_L23 power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption/10000.0));
|
|
|
- DEBUG_INFO("MCU-%d get L3N_L31 power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption/10000.0));
|
|
|
- }
|
|
|
-
|
|
|
- previousCharger.gun_info[gun_index].primaryMcuState.cp_state = ShmCharger->gun_info[gun_index].primaryMcuState.cp_state;
|
|
|
- previousCharger.gun_info[gun_index].primaryMcuState.current_limit = ShmCharger->gun_info[gun_index].primaryMcuState.current_limit;
|
|
|
- previousCharger.gun_info[gun_index].primaryMcuState.relay_state = ShmCharger->gun_info[gun_index].primaryMcuState.relay_state;
|
|
|
- previousCharger.gun_info[gun_index].primaryMcuState.socket_e.isSocketEMode = ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEMode;
|
|
|
- previousCharger.gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn = ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn;
|
|
|
- }
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Query primary MCU Alarm code
|
|
|
- //===============================
|
|
|
- if((previousCharger.gun_info[gun_index].primaryMcuAlarm.InputAlarmCode != ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode))
|
|
|
- {
|
|
|
- if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode>0))
|
|
|
- {
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("***** High priority polling : Case 4 ******\n");
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("MCU-%d get OVP_L1 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OVP_L1);
|
|
|
- DEBUG_INFO("MCU-%d get UVP_L1 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.UVP_L1);
|
|
|
- DEBUG_INFO("MCU-%d get OCP_L1 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L1);
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
- {
|
|
|
- DEBUG_INFO("MCU-%d get OVP_L2 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OVP_L2);
|
|
|
- DEBUG_INFO("MCU-%d get UVP_L2 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.UVP_L2);
|
|
|
- DEBUG_INFO("MCU-%d get OCP_L2 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L2);
|
|
|
- DEBUG_INFO("MCU-%d get OVP_L3 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OVP_L3);
|
|
|
- DEBUG_INFO("MCU-%d get UVP_L3 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.UVP_L3);
|
|
|
- DEBUG_INFO("MCU-%d get OCP_L3 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP_L3);
|
|
|
- }
|
|
|
- DEBUG_INFO("MCU-%d get OTP : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OTP);
|
|
|
- DEBUG_INFO("MCU-%d get gmi_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.gmi_fault);
|
|
|
- DEBUG_INFO("MCU-%d get cp_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.cp_fault);
|
|
|
- DEBUG_INFO("MCU-%d get ac_leak : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.ac_leak);
|
|
|
- DEBUG_INFO("MCU-%d get dc_leak : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.dc_leak);
|
|
|
- DEBUG_INFO("MCU-%d get mcu_selftest_fail : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.mcu_selftest_fail);
|
|
|
- DEBUG_INFO("MCU-%d get handshaking_timeout : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.handshaking_timeout);
|
|
|
- DEBUG_INFO("MCU-%d get emergency_stop : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.emergency_stop);
|
|
|
- DEBUG_INFO("MCU-%d get relay_welding : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.relay_welding);
|
|
|
- DEBUG_INFO("MCU-%d get leak_module_fail : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.leak_module_fail);
|
|
|
- DEBUG_INFO("MCU-%d get shutter_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.shutter_fault);
|
|
|
- DEBUG_INFO("MCU-%d get locker_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.locker_fault);
|
|
|
- DEBUG_INFO("MCU-%d get power_drop : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.power_drop);
|
|
|
- DEBUG_INFO("MCU-%d get rotate_switch_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.rotate_switch_fault);
|
|
|
- DEBUG_INFO("MCU-%d get short_circuit_L1 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.short_circuit_L1);
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
- {
|
|
|
- DEBUG_INFO("MCU-%d get short_circuit_L2 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.short_circuit_L2);
|
|
|
- DEBUG_INFO("MCU-%d get short_circuit_L3 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.short_circuit_L3);
|
|
|
- }
|
|
|
- DEBUG_INFO("MCU-%d get relay_drive_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.relay_drive_fault);
|
|
|
- DEBUG_INFO("MCU-%d get meter_comm_timeout : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.meter_comm_timeout);
|
|
|
- DEBUG_INFO("MCU-%d get meter_ic_comm_timeout : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.meter_ic_comm_timeout);
|
|
|
- DEBUG_INFO("MCU-%d get pilot_negative_error : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.pilot_negative_error);
|
|
|
- DEBUG_INFO("MCU-%d get InputAlarmCode : %x\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode);
|
|
|
- }
|
|
|
-
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("==== Normal priority polling : Case 1 =====\n");
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("MCU-%d get Input voltage L1: %.2f\n", gun_index, (float)ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12);
|
|
|
- DEBUG_INFO("MCU-%d get PresentChargingVoltage L1: %.2f\n", gun_index, (float)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltage);
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
- {
|
|
|
- DEBUG_INFO("MCU-%d get Input voltage L2: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].inputVoltage.L2N_L23);
|
|
|
- DEBUG_INFO("MCU-%d get PresentChargingVoltage L2: %.2f\n", gun_index, (float)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltageL2);
|
|
|
- DEBUG_INFO("MCU-%d get Input voltage L3: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].inputVoltage.L3N_L31);
|
|
|
- DEBUG_INFO("MCU-%d get PresentChargingVoltage L3: %.2f\n", gun_index, (float)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltageL3);
|
|
|
- }
|
|
|
-
|
|
|
- previousCharger.gun_info[gun_index].primaryMcuAlarm.InputAlarmCode = ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode;
|
|
|
- }
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Query primary Out put current config
|
|
|
- //===============================
|
|
|
- /*
|
|
|
- if((previousCharger.gun_info[gun_index].outputCurrent.L1N_L12[0] != ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]) ||
|
|
|
- (previousCharger.gun_info[gun_index].outputCurrent.L2N_L23[0] != ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0]) ||
|
|
|
- (previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] != ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0]))
|
|
|
- {
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("===== High priority polling : Case 11 =====\n");
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("MCU-%d get output current L1: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]);
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
- {
|
|
|
- DEBUG_INFO("MCU-%d get output current L2: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0]);
|
|
|
- DEBUG_INFO("MCU-%d get output current L3: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0]);
|
|
|
- }
|
|
|
-
|
|
|
- previousCharger.gun_info[gun_index].outputCurrent.L1N_L12[0] = ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];
|
|
|
- previousCharger.gun_info[gun_index].outputCurrent.L2N_L23[0] = ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0];
|
|
|
- previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] = ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0];
|
|
|
- }
|
|
|
- */
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Query primary MCU BLE config
|
|
|
- //===============================
|
|
|
- /*
|
|
|
- if((previousCharger.gun_info[gun_index].bleConfigData.isLogin != ShmCharger->gun_info[gun_index].bleConfigData.isLogin) ||
|
|
|
- (previousCharger.gun_info[gun_index].bleConfigData.isRequestStart != ShmCharger->gun_info[gun_index].bleConfigData.isRequestStart) ||
|
|
|
- (previousCharger.gun_info[gun_index].bleConfigData.isRequestStop != ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop))
|
|
|
- {
|
|
|
- if(ShmCharger->gun_info[gun_index].bleConfigData.isLogin == ON)
|
|
|
- {
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("***** High priority polling : Case 5 ******\n");
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("MCU-%d get isUserLogin : %d\n", gun_index, ShmCharger->gun_info[gun_index].bleConfigData.isLogin);
|
|
|
- DEBUG_INFO("MCU-%d get isRequestStartCharger : %d\n", gun_index, ShmCharger->gun_info[gun_index].bleConfigData.isRequestStart);
|
|
|
- DEBUG_INFO("MCU-%d get isRequestStopCharger : %d\n", gun_index, ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop);
|
|
|
- }
|
|
|
-
|
|
|
- previousCharger.gun_info[gun_index].bleConfigData.isLogin = ShmCharger->gun_info[gun_index].bleConfigData.isLogin;
|
|
|
- previousCharger.gun_info[gun_index].bleConfigData.isRequestStart = ShmCharger->gun_info[gun_index].bleConfigData.isRequestStart;
|
|
|
- previousCharger.gun_info[gun_index].bleConfigData.isRequestStop = ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop;
|
|
|
- }
|
|
|
- */
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Query primary MCU ble login id
|
|
|
- //===============================
|
|
|
- /*
|
|
|
- if((strcmp((char *)&previousCharger.gun_info[gun_index].bleLoginCentralId.id,(char *)&ShmCharger->gun_info[gun_index].bleLoginCentralId.id) != 0))
|
|
|
- {
|
|
|
- if(strcmp((char *)&ShmCharger->gun_info[gun_index].bleLoginCentralId.id,"") != 0)
|
|
|
- {
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("***** High priority polling : Case 6 ******\n");
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("MCU-%d get ble central id : %s\n", gun_index, ShmCharger->gun_info[gun_index].bleLoginCentralId.id);
|
|
|
- }
|
|
|
-
|
|
|
- memcpy(&previousCharger.gun_info[gun_index].bleLoginCentralId.id, ShmCharger->gun_info[gun_index].bleLoginCentralId.id, ARRAY_SIZE(ShmCharger->gun_info[gun_index].bleLoginCentralId.id));
|
|
|
- }
|
|
|
- */
|
|
|
- }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2857,177 +3045,6 @@ int main(void)
|
|
|
stepIndex = 0;
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
- //==========================================================
|
|
|
- // Low priority polling log print out
|
|
|
- //==========================================================
|
|
|
- if((current_timestamp() - tsPrintLog[PRIORITY_LOW]) > (ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest?3000:6000))
|
|
|
- {
|
|
|
- tsPrintLog[PRIORITY_LOW] = current_timestamp();
|
|
|
-
|
|
|
- switch(logIndex)
|
|
|
- {
|
|
|
- case 1:
|
|
|
- if((previousCharger.gun_info[gun_index].outputCurrent.L1N_L12[0] != ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]) ||
|
|
|
- (previousCharger.gun_info[gun_index].outputCurrent.L2N_L23[0] != ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0]) ||
|
|
|
- (previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] != ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0]))
|
|
|
- {
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("************* Output Current **************\n");
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("MCU-%d get output current L1: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]);
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
- {
|
|
|
- DEBUG_INFO("MCU-%d get output current L2: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0]);
|
|
|
- DEBUG_INFO("MCU-%d get output current L3: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0]);
|
|
|
- }
|
|
|
-
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("************ Power Consumption ************\n");
|
|
|
- DEBUG_INFO("*******************************************\n");
|
|
|
- DEBUG_INFO("MCU-%d get total power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0));
|
|
|
- DEBUG_INFO("MCU-%d get L1N_L12 power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption[0].power_consumption/10000.0));
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
- {
|
|
|
- DEBUG_INFO("MCU-%d get L2N_L23 power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption[1].power_consumption/10000.0));
|
|
|
- DEBUG_INFO("MCU-%d get L3N_L31 power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption[2].power_consumption/10000.0));
|
|
|
- }
|
|
|
-
|
|
|
- previousCharger.gun_info[gun_index].outputCurrent.L1N_L12[0] = ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];
|
|
|
- previousCharger.gun_info[gun_index].outputCurrent.L2N_L23[0] = ShmCharger->gun_info[gun_index].outputCurrent.L2N_L23[0];
|
|
|
- previousCharger.gun_info[gun_index].outputCurrent.L3N_L31[0] = ShmCharger->gun_info[gun_index].outputCurrent.L3N_L31[0];
|
|
|
- }
|
|
|
-
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- if(previousCharger.gun_info[gun_index].gunPluginTimes.GunPluginTimes != ShmCharger->gun_info[gun_index].gunPluginTimes.GunPluginTimes)
|
|
|
- {
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("==== Normal priority polling : Case 5 =====\n");
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("MCU-%d get gun plugin times : %ld\n", gun_index, (long)ShmCharger->gun_info[gun_index].gunPluginTimes.GunPluginTimes);
|
|
|
-
|
|
|
- previousCharger.gun_info[gun_index].gunPluginTimes.GunPluginTimes = ShmCharger->gun_info[gun_index].gunPluginTimes.GunPluginTimes;
|
|
|
- }
|
|
|
-
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- if(previousCharger.gun_info[gun_index].temperature.point[0] != ShmCharger->gun_info[gun_index].temperature.point[0])
|
|
|
- {
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("==== Normal priority polling : Case 7 =====\n");
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("MCU-%d get temperature : %d\n", gun_index, ShmCharger->gun_info[gun_index].temperature.point[0]);
|
|
|
-
|
|
|
- previousCharger.gun_info[gun_index].temperature.point[0] = ShmCharger->gun_info[gun_index].temperature.point[0];
|
|
|
- }
|
|
|
-
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- if(previousCharger.gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current != ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current)
|
|
|
- {
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("==== Normal priority polling : Case 9 =====\n");
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("MCU-%d set cp pwn duty : %d\n",gun_index, ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current);
|
|
|
-
|
|
|
- previousCharger.gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current;
|
|
|
- }
|
|
|
-
|
|
|
- break;
|
|
|
- case 5:
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("==== Normal priority polling : Case 11 ====\n");
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- if(ShmCharger->gun_info[gun_index].bleConfigData.isLogin && !ShmOCPP16Data->OcppConnStatus)
|
|
|
- {
|
|
|
- DEBUG_INFO("Sync from MCU-%d rtc OK...%04d-%02d-%02d %02d:%02d:%02d\n", gun_index,
|
|
|
- ShmCharger->gun_info[gun_index].rtc.year,
|
|
|
- ShmCharger->gun_info[gun_index].rtc.month,
|
|
|
- ShmCharger->gun_info[gun_index].rtc.day,
|
|
|
- ShmCharger->gun_info[gun_index].rtc.hour,
|
|
|
- ShmCharger->gun_info[gun_index].rtc.min,
|
|
|
- ShmCharger->gun_info[gun_index].rtc.sec);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- DEBUG_INFO("MCU-%d set rtc OK...%04d-%02d-%02d %02d:%02d:%02d\n", gun_index,
|
|
|
- ShmCharger->gun_info[gun_index].rtc.year,
|
|
|
- ShmCharger->gun_info[gun_index].rtc.month,
|
|
|
- ShmCharger->gun_info[gun_index].rtc.day,
|
|
|
- ShmCharger->gun_info[gun_index].rtc.hour,
|
|
|
- ShmCharger->gun_info[gun_index].rtc.min,
|
|
|
- ShmCharger->gun_info[gun_index].rtc.sec);
|
|
|
- }
|
|
|
- break;
|
|
|
- case 6:
|
|
|
- break;
|
|
|
- case 7:
|
|
|
- if(ShmCharger->gun_info[gun_index].isSetBreatheLedTiming == ON)
|
|
|
- {
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("==== Normal priority polling : Case 15 ====\n");
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("MCU-%d set breathe led timing : Authed Fade in [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_In);
|
|
|
- DEBUG_INFO("MCU-%d set breathe led timing : Authed Fade out [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_Out);
|
|
|
- DEBUG_INFO("MCU-%d set breathe led timing : Charging Fade in [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.Set_Led_Action_Chaging_Fade_In);
|
|
|
- DEBUG_INFO("MCU-%d set breathe led timing : Charging Fade out [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Chaging_Fade_Out);
|
|
|
- DEBUG_INFO("MCU-%d set breathe led timing : Connected Fade in [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_In);
|
|
|
- DEBUG_INFO("MCU-%d set breathe led timing : Connected Fade out [%ld].\n", gun_index, (long)ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_Out);
|
|
|
- }
|
|
|
- break;
|
|
|
- case 8:
|
|
|
- if(ShmCharger->gun_info[gun_index].isSetLedBrightness == ON)
|
|
|
- {
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("==== Normal priority polling : Case 17 ====\n");
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("MCU-%d set led brightness Sector 01 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_1);
|
|
|
- DEBUG_INFO("MCU-%d set led brightness Sector 02 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_2);
|
|
|
- DEBUG_INFO("MCU-%d set led brightness Sector 03 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_3);
|
|
|
- DEBUG_INFO("MCU-%d set led brightness Sector 04 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_4);
|
|
|
- DEBUG_INFO("MCU-%d set led brightness Sector 05 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_5);
|
|
|
- DEBUG_INFO("MCU-%d set led brightness Sector 06 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_6);
|
|
|
- DEBUG_INFO("MCU-%d set led brightness Sector 07 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_7);
|
|
|
- DEBUG_INFO("MCU-%d set led brightness Sector 08 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_8);
|
|
|
- DEBUG_INFO("MCU-%d set led brightness Sector 09 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_9);
|
|
|
- DEBUG_INFO("MCU-%d set led brightness Sector 10 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_10);
|
|
|
- DEBUG_INFO("MCU-%d set led brightness Sector 11 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_11);
|
|
|
- DEBUG_INFO("MCU-%d set led brightness Sector 12 : [%x].\n", gun_index, ShmCharger->gun_info[gun_index].setLedBrightness.sector_12);
|
|
|
- }
|
|
|
- break;
|
|
|
- default:
|
|
|
- /*
|
|
|
- if((previousCharger.gun_info[gun_index].inputVoltage.L1N_L12 != ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12) ||
|
|
|
- (previousCharger.gun_info[gun_index].inputVoltage.L2N_L23 != ShmCharger->gun_info[gun_index].inputVoltage.L2N_L23) ||
|
|
|
- (previousCharger.gun_info[gun_index].inputVoltage.L3N_L31 != ShmCharger->gun_info[gun_index].inputVoltage.L3N_L31))
|
|
|
- {
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("==== Normal priority polling : Case 1 =====\n");
|
|
|
- DEBUG_INFO("===========================================\n");
|
|
|
- DEBUG_INFO("MCU-%d get Input voltage L1: %.2f\n", gun_index, (float)ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12);
|
|
|
- DEBUG_INFO("MCU-%d get PresentChargingVoltage L1: %.2f\n", gun_index, (float)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltage);
|
|
|
-
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.AcPhaseCount == 3)
|
|
|
- {
|
|
|
- DEBUG_INFO("MCU-%d get Input voltage L2: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].inputVoltage.L2N_L23);
|
|
|
- DEBUG_INFO("MCU-%d get PresentChargingVoltage L2: %.2f\n", gun_index, (float)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltageL2);
|
|
|
- DEBUG_INFO("MCU-%d get Input voltage L3: %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].inputVoltage.L3N_L31);
|
|
|
- DEBUG_INFO("MCU-%d get PresentChargingVoltage L3: %.2f\n", gun_index, (float)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltageL3);
|
|
|
- }
|
|
|
-
|
|
|
- previousCharger.gun_info[gun_index].inputVoltage.L1N_L12 = ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12;
|
|
|
- previousCharger.gun_info[gun_index].inputVoltage.L2N_L23 = ShmCharger->gun_info[gun_index].inputVoltage.L2N_L23;
|
|
|
- previousCharger.gun_info[gun_index].inputVoltage.L3N_L31 = ShmCharger->gun_info[gun_index].inputVoltage.L3N_L31;
|
|
|
- }
|
|
|
- */
|
|
|
-
|
|
|
- logIndex = 0;
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- logIndex++;
|
|
|
- }
|
|
|
}
|
|
|
stepIndex++;
|
|
|
|