|
@@ -1749,7 +1749,8 @@ int main(void)
|
|
|
int Uart1Fd;
|
|
|
|
|
|
unsigned short int failCount[2] = {0,0};
|
|
|
- unsigned short int printOutCount[2] = {0,0};
|
|
|
+
|
|
|
+ Gun_Info previous_gun_info[AC_QUANTITY];
|
|
|
|
|
|
if(InitShareMemory() == FAIL)
|
|
|
{
|
|
@@ -1784,6 +1785,315 @@ 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++)
|
|
|
+ {
|
|
|
+ //===============================
|
|
|
+ // Config primary MCU LED
|
|
|
+ //===============================
|
|
|
+ if((previous_gun_info[gun_index].primaryMcuLed.mode != ShmCharger->gun_info[gun_index].primaryMcuLed.mode) ||
|
|
|
+ (previous_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);
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].primaryMcuLed.mode = ShmCharger->gun_info[gun_index].primaryMcuLed.mode;
|
|
|
+ previous_gun_info[gun_index].primaryMcuLed.alarm_code = ShmCharger->gun_info[gun_index].primaryMcuLed.alarm_code;
|
|
|
+ }
|
|
|
+
|
|
|
+ //===============================
|
|
|
+ // Config primary Legacy request
|
|
|
+ //===============================
|
|
|
+ if(previous_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 permission request : %d\n", gun_index, ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest);
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].legacyRequest.isLegacyRequest = ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest;
|
|
|
+ }
|
|
|
+
|
|
|
+ //===============================
|
|
|
+ // Query primary MCU status
|
|
|
+ //===============================
|
|
|
+ if((previous_gun_info[gun_index].primaryMcuState.cp_state != ShmCharger->gun_info[gun_index].primaryMcuState.cp_state) ||
|
|
|
+ (previous_gun_info[gun_index].primaryMcuState.current_limit != ShmCharger->gun_info[gun_index].primaryMcuState.current_limit) ||
|
|
|
+ (previous_gun_info[gun_index].primaryMcuState.cp_voltage_positive != ShmCharger->gun_info[gun_index].primaryMcuState.cp_voltage_positive) ||
|
|
|
+ (previous_gun_info[gun_index].primaryMcuState.cp_voltage_negtive != ShmCharger->gun_info[gun_index].primaryMcuState.cp_voltage_negtive) ||
|
|
|
+ (previous_gun_info[gun_index].primaryMcuState.relay_state != ShmCharger->gun_info[gun_index].primaryMcuState.relay_state) ||
|
|
|
+ (previous_gun_info[gun_index].primaryMcuState.rating_current != ShmCharger->gun_info[gun_index].primaryMcuState.rating_current) ||
|
|
|
+ (previous_gun_info[gun_index].primaryMcuState.rotatory_switch != ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch))
|
|
|
+ {
|
|
|
+ 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);
|
|
|
+ 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 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);
|
|
|
+ */
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].primaryMcuState.cp_state = ShmCharger->gun_info[gun_index].primaryMcuState.cp_state;
|
|
|
+ previous_gun_info[gun_index].primaryMcuState.current_limit = ShmCharger->gun_info[gun_index].primaryMcuState.current_limit;
|
|
|
+ previous_gun_info[gun_index].primaryMcuState.cp_voltage_positive = ShmCharger->gun_info[gun_index].primaryMcuState.cp_voltage_positive;
|
|
|
+ previous_gun_info[gun_index].primaryMcuState.cp_voltage_negtive = ShmCharger->gun_info[gun_index].primaryMcuState.cp_voltage_negtive;
|
|
|
+ previous_gun_info[gun_index].primaryMcuState.relay_state = ShmCharger->gun_info[gun_index].primaryMcuState.relay_state;
|
|
|
+ previous_gun_info[gun_index].primaryMcuState.rating_current = ShmCharger->gun_info[gun_index].primaryMcuState.rating_current;
|
|
|
+ previous_gun_info[gun_index].primaryMcuState.rotatory_switch = ShmCharger->gun_info[gun_index].primaryMcuState.rotatory_switch;
|
|
|
+ }
|
|
|
+
|
|
|
+ //===============================
|
|
|
+ // Query primary MCU Alarm code
|
|
|
+ //===============================
|
|
|
+ if(previous_gun_info[gun_index].primaryMcuAlarm.InputAlarmCode != ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("**************************************************\n");
|
|
|
+ DEBUG_INFO("********* High priority polling : Case 4 *********\n");
|
|
|
+ DEBUG_INFO("**************************************************\n");
|
|
|
+ DEBUG_INFO("MCU-%d get OVP : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OVP);
|
|
|
+ DEBUG_INFO("MCU-%d get UVP : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.UVP);
|
|
|
+ DEBUG_INFO("MCU-%d get OCP : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP);
|
|
|
+ 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 circuit_short : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.circuit_short);
|
|
|
+ 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 relay_drive_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.relay_drive_fault);
|
|
|
+ DEBUG_INFO("MCU-%d get InputAlarmCode : %x\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode);
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].primaryMcuAlarm.InputAlarmCode = ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ //===============================
|
|
|
+ // Query present output current
|
|
|
+ //===============================
|
|
|
+ if(previous_gun_info[gun_index].outputCurrent.L1N_L12[0] != ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0])
|
|
|
+ {
|
|
|
+ DEBUG_INFO("**************************************************\n");
|
|
|
+ DEBUG_INFO("********* High priority polling : Case 5 *********\n");
|
|
|
+ DEBUG_INFO("**************************************************\n");
|
|
|
+ DEBUG_INFO("MCU-%d get output current : %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]);
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].outputCurrent.L1N_L12[0] = ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0];
|
|
|
+ }
|
|
|
+
|
|
|
+ //===============================
|
|
|
+ // Query primary MCU BLE config
|
|
|
+ //===============================
|
|
|
+ /*
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
+ //===============================
|
|
|
+ // Query primary MCU ble login id
|
|
|
+ //===============================
|
|
|
+ /*
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
+ //===============================
|
|
|
+ // Config primary MCU duty
|
|
|
+ //===============================
|
|
|
+ if(previous_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);
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current;
|
|
|
+ }
|
|
|
+
|
|
|
+ //==========================================================
|
|
|
+ // Low priority polling log print out
|
|
|
+ //==========================================================
|
|
|
+ if(previous_gun_info[gun_index].inputVoltage.L1N_L12 != ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("==================================================\n");
|
|
|
+ DEBUG_INFO("======== Normal priority polling : Case 1 ========\n");
|
|
|
+ DEBUG_INFO("==================================================\n");
|
|
|
+ DEBUG_INFO("MCU-%d get input voltage : %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12);
|
|
|
+ DEBUG_INFO("MCU-%d get PresentChargingVoltage : %.2f\n", gun_index, (float)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltage);
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].inputVoltage.L1N_L12 = ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(previous_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);
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].gunPluginTimes.GunPluginTimes = ShmCharger->gun_info[gun_index].gunPluginTimes.GunPluginTimes;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(previous_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]);
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].temperature.point[0] = ShmCharger->gun_info[gun_index].temperature.point[0];
|
|
|
+ }
|
|
|
+
|
|
|
+ if(previous_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);
|
|
|
+ }
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].rtc.min = ShmCharger->gun_info[gun_index].rtc.min;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(previous_gun_info[gun_index].powerConsumption.power_consumption != ShmCharger->gun_info[gun_index].powerConsumption.power_consumption)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("==================================================\n");
|
|
|
+ DEBUG_INFO("======== Normal priority polling : Case 13 =======\n");
|
|
|
+ DEBUG_INFO("==================================================\n");
|
|
|
+ DEBUG_INFO("MCU-%d get power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption.power_consumption/100));
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].powerConsumption.power_consumption = ShmCharger->gun_info[gun_index].powerConsumption.power_consumption;
|
|
|
+ }
|
|
|
+
|
|
|
+ if((previous_gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_In != ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_In) ||
|
|
|
+ (previous_gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_Out != ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_Out) ||
|
|
|
+ (previous_gun_info[gun_index].setBreatheLedTiming.Set_Led_Action_Chaging_Fade_In != ShmCharger->gun_info[gun_index].setBreatheLedTiming.Set_Led_Action_Chaging_Fade_In) ||
|
|
|
+ (previous_gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Chaging_Fade_Out != ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Chaging_Fade_Out) ||
|
|
|
+ (previous_gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_In != ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_In) ||
|
|
|
+ (previous_gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_Out != ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_Out))
|
|
|
+ {
|
|
|
+ DEBUG_INFO("==================================================\n");
|
|
|
+ DEBUG_INFO("======== Normal priority polling : Case 17 =======\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);
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_In = ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_In;
|
|
|
+ previous_gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_Out = ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Authed_Fade_Out;
|
|
|
+ previous_gun_info[gun_index].setBreatheLedTiming.Set_Led_Action_Chaging_Fade_In = ShmCharger->gun_info[gun_index].setBreatheLedTiming.Set_Led_Action_Chaging_Fade_In;
|
|
|
+ previous_gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Chaging_Fade_Out = ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Chaging_Fade_Out;
|
|
|
+ previous_gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_In = ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_In;
|
|
|
+ previous_gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_Out = ShmCharger->gun_info[gun_index].setBreatheLedTiming.set_Led_Action_Connected_Fade_Out;
|
|
|
+ }
|
|
|
+
|
|
|
+ if((previous_gun_info[gun_index].setLedBrightness.sector_1 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_1) ||
|
|
|
+ (previous_gun_info[gun_index].setLedBrightness.sector_2 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_2) ||
|
|
|
+ (previous_gun_info[gun_index].setLedBrightness.sector_3 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_3) ||
|
|
|
+ (previous_gun_info[gun_index].setLedBrightness.sector_4 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_4) ||
|
|
|
+ (previous_gun_info[gun_index].setLedBrightness.sector_5 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_5) ||
|
|
|
+ (previous_gun_info[gun_index].setLedBrightness.sector_6 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_6) ||
|
|
|
+ (previous_gun_info[gun_index].setLedBrightness.sector_7 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_7) ||
|
|
|
+ (previous_gun_info[gun_index].setLedBrightness.sector_8 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_8) ||
|
|
|
+ (previous_gun_info[gun_index].setLedBrightness.sector_9 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_9) ||
|
|
|
+ (previous_gun_info[gun_index].setLedBrightness.sector_10 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_10) ||
|
|
|
+ (previous_gun_info[gun_index].setLedBrightness.sector_11 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_11) ||
|
|
|
+ (previous_gun_info[gun_index].setLedBrightness.sector_12 != ShmCharger->gun_info[gun_index].setLedBrightness.sector_12))
|
|
|
+ {
|
|
|
+ DEBUG_INFO("==================================================\n");
|
|
|
+ DEBUG_INFO("======== Normal priority polling : Case 19 =======\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);
|
|
|
+
|
|
|
+ previous_gun_info[gun_index].setLedBrightness.sector_1 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_1;
|
|
|
+ previous_gun_info[gun_index].setLedBrightness.sector_2 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_2;
|
|
|
+ previous_gun_info[gun_index].setLedBrightness.sector_3 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_3;
|
|
|
+ previous_gun_info[gun_index].setLedBrightness.sector_4 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_4;
|
|
|
+ previous_gun_info[gun_index].setLedBrightness.sector_5 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_5;
|
|
|
+ previous_gun_info[gun_index].setLedBrightness.sector_6 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_6;
|
|
|
+ previous_gun_info[gun_index].setLedBrightness.sector_7 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_7;
|
|
|
+ previous_gun_info[gun_index].setLedBrightness.sector_8 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_8;
|
|
|
+ previous_gun_info[gun_index].setLedBrightness.sector_9 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_9;
|
|
|
+ previous_gun_info[gun_index].setLedBrightness.sector_10 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_10;
|
|
|
+ previous_gun_info[gun_index].setLedBrightness.sector_11 = ShmCharger->gun_info[gun_index].setLedBrightness.sector_11;
|
|
|
+ previous_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++)
|
|
@@ -1796,7 +2106,6 @@ int main(void)
|
|
|
/*
|
|
|
* High priority communication
|
|
|
*/
|
|
|
-
|
|
|
//===============================
|
|
|
// Case 1 : Config primary MCU LED
|
|
|
//===============================
|
|
@@ -2114,141 +2423,6 @@ int main(void)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- //==========================================================
|
|
|
- // High priority polling log print out
|
|
|
- //==========================================================
|
|
|
- if(ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest == ON)
|
|
|
- {
|
|
|
- PRINT_OUT_LEVEL_STATE = LEVEL_1;
|
|
|
- if(printOutCount[gun_index]>LEVEL_1)
|
|
|
- printOutCount[gun_index] = 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- PRINT_OUT_LEVEL_STATE = LEVEL_2;
|
|
|
- if(printOutCount[gun_index]>LEVEL_2)
|
|
|
- printOutCount[gun_index] = 0;
|
|
|
- }
|
|
|
-
|
|
|
- if(printOutCount[gun_index] == PRINT_OUT_LEVEL_STATE)
|
|
|
- {
|
|
|
- //===============================
|
|
|
- // Config primary MCU LED
|
|
|
- //===============================
|
|
|
- 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);
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Config primary Legacy request
|
|
|
- //===============================
|
|
|
- DEBUG_INFO("**************************************************\n");
|
|
|
- DEBUG_INFO("********* High priority polling : Case 2 *********\n");
|
|
|
- DEBUG_INFO("**************************************************\n");
|
|
|
- DEBUG_INFO("MCU-%d set permission request : %d\n", gun_index, ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest);
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Query primary MCU status
|
|
|
- //===============================
|
|
|
- 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);
|
|
|
- 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 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 Alarm code
|
|
|
- //===============================
|
|
|
- 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 : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OVP);
|
|
|
- DEBUG_INFO("MCU-%d get UVP : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.UVP);
|
|
|
- DEBUG_INFO("MCU-%d get OCP : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.OCP);
|
|
|
- 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 circuit_short : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.circuit_short);
|
|
|
- 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 relay_drive_fault : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.bits.relay_drive_fault);
|
|
|
- DEBUG_INFO("MCU-%d get InputAlarmCode : %x\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode);
|
|
|
- }
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Query present output current
|
|
|
- //===============================
|
|
|
- DEBUG_INFO("==================================================\n");
|
|
|
- DEBUG_INFO("========= High priority polling : Case 5 =========\n");
|
|
|
- DEBUG_INFO("==================================================\n");
|
|
|
- DEBUG_INFO("MCU-%d get output current : %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0]);
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Query primary MCU BLE config
|
|
|
- //===============================
|
|
|
- /*
|
|
|
- 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);
|
|
|
- }
|
|
|
- */
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Query primary MCU ble login id
|
|
|
- //===============================
|
|
|
- /*
|
|
|
- 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);
|
|
|
- }
|
|
|
- */
|
|
|
-
|
|
|
- //===============================
|
|
|
- // Config primary MCU duty
|
|
|
- //===============================
|
|
|
- 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);
|
|
|
-
|
|
|
- usleep(100000);
|
|
|
- }
|
|
|
-
|
|
|
- printOutCount[gun_index]++;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2449,6 +2623,7 @@ int main(void)
|
|
|
if(Config_AC_Set_Breathe_Led_Timing(Uart1Fd, (gun_index>0?ADDR_AC_PRIMARY_2:ADDR_AC_PRIMARY_1), &ShmCharger->gun_info[gun_index].setBreatheLedTiming))
|
|
|
{
|
|
|
failCount[gun_index] = 0;
|
|
|
+ ShmCharger->gun_info[gun_index].isSetBreatheLedTiming = OFF;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2469,6 +2644,7 @@ int main(void)
|
|
|
if(Config_AC_Set_Led_Brightness(Uart1Fd, (gun_index>0?ADDR_AC_PRIMARY_2:ADDR_AC_PRIMARY_1), &ShmCharger->gun_info[gun_index].setLedBrightness))
|
|
|
{
|
|
|
failCount[gun_index] = 0;
|
|
|
+ ShmCharger->gun_info[gun_index].isSetLedBrightness = OFF;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2563,116 +2739,6 @@ int main(void)
|
|
|
stepIndex = 0;
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
- //==========================================================
|
|
|
- // Low priority polling log print out
|
|
|
- //==========================================================
|
|
|
- if(printOutCount[gun_index] == PRINT_OUT_LEVEL_STATE)
|
|
|
- {
|
|
|
- if(stepIndex == 1)
|
|
|
- {
|
|
|
- DEBUG_INFO("==================================================\n");
|
|
|
- DEBUG_INFO("======== Normal priority polling : Case 1 ========\n");
|
|
|
- DEBUG_INFO("==================================================\n");
|
|
|
- DEBUG_INFO("MCU-%d get input voltage : %f\n", gun_index, (float)ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12);
|
|
|
- DEBUG_INFO("MCU-%d get PresentChargingVoltage : %.2f\n", gun_index, (float)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargingVoltage);
|
|
|
- }
|
|
|
- else if(stepIndex == 3)
|
|
|
- {
|
|
|
- // Reserved
|
|
|
- }
|
|
|
- else if(stepIndex == 5)
|
|
|
- {
|
|
|
- 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);
|
|
|
- }
|
|
|
- else if(stepIndex == 7)
|
|
|
- {
|
|
|
- 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]);
|
|
|
- }
|
|
|
- else if(stepIndex == 9)
|
|
|
- {
|
|
|
- // Reserved
|
|
|
- }
|
|
|
- else if(stepIndex == 11)
|
|
|
- {
|
|
|
- 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);
|
|
|
- }
|
|
|
- }
|
|
|
- else if(stepIndex == 13)
|
|
|
- {
|
|
|
- DEBUG_INFO("==================================================\n");
|
|
|
- DEBUG_INFO("======== Normal priority polling : Case 13 =======\n");
|
|
|
- DEBUG_INFO("==================================================\n");
|
|
|
- DEBUG_INFO("MCU-%d get power consumption : %f kWh\n",gun_index, ((float)ShmCharger->gun_info[gun_index].powerConsumption.power_consumption/100));
|
|
|
- }
|
|
|
- else if(stepIndex == 17)
|
|
|
- {
|
|
|
- if(ShmCharger->gun_info[gun_index].isSetBreatheLedTiming == ON)
|
|
|
- {
|
|
|
- DEBUG_INFO("==================================================\n");
|
|
|
- DEBUG_INFO("======== Normal priority polling : Case 17 =======\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);
|
|
|
- }
|
|
|
- }
|
|
|
- else if(stepIndex == 19)
|
|
|
- {
|
|
|
- if(ShmCharger->gun_info[gun_index].isSetLedBrightness == ON)
|
|
|
- {
|
|
|
- DEBUG_INFO("==================================================\n");
|
|
|
- DEBUG_INFO("======== Normal priority polling : Case 19 =======\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);
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {}
|
|
|
- }
|
|
|
}
|
|
|
stepIndex++;
|
|
|
|