|
@@ -36,6 +36,7 @@
|
|
|
|
|
|
#define FAIL_SPEC_COMM 100
|
|
|
#define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
|
|
|
+#define GET_BIT(x, pos) ((x & ( 1 << pos)) >> pos)
|
|
|
#define PASS 1
|
|
|
#define FAIL 0
|
|
|
#define ON 1
|
|
@@ -777,6 +778,7 @@ unsigned char Query_AC_MCU_Status(unsigned char fd, unsigned char targetAddr, Ac
|
|
|
Ret_Buf->pp_state = rx[17];
|
|
|
Ret_Buf->rating_current = rx[18];
|
|
|
Ret_Buf->rotatory_switch = (rx[19] & 0x0F);
|
|
|
+ Ret_Buf->dip_switch = GET_BIT(rx[19], 4);
|
|
|
Ret_Buf->socket_e.isSocketEMode = (rx[20] & 0x01);
|
|
|
Ret_Buf->socket_e.isSocketEPinOn = ((rx[20]>>1) & 0x01);
|
|
|
|
|
@@ -2185,6 +2187,8 @@ int main(void)
|
|
|
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 Locker State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.locker_state);
|
|
|
+ DEBUG_INFO("MCU-%d get Relay State : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.relay_state);
|
|
|
|
|
|
if(ShmCharger->gun_info[gun_index].primaryMcuState.relay_state == ON)
|
|
|
{
|
|
@@ -2194,15 +2198,14 @@ int main(void)
|
|
|
DEBUG_INFO("Relay 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 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);
|
|
|
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 Dip Switch : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.dip_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;
|