Skip to content

Commit d415716

Browse files
committed
save
1 parent 762ade0 commit d415716

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Charger/main.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int main()
8686

8787
max_voltage_mV = VOLTAGE_TARGET_MV;
8888

89-
// printf("pp_ready: %x, precharge done: %x, fault: %x, sh closed: %x, cell temps fine: %x\n", proximity_pilot_ready, prechargeDone, fault, shutdown_closed, cell_temps_fine);
89+
printf("pp_ready: %x, precharge done: %x, fault: %x, sh closed: %x, cell temps fine: %x\n", proximity_pilot_ready, prechargeDone, fault, shutdown_closed, cell_temps_fine);
9090
enable = proximity_pilot_ready && prechargeDone && !fault && shutdown_closed && cell_temps_fine;
9191
printf("Enable: %x\nVoltage: %f\nSOC: %d\n\n", enable, pack_voltage / 100.0, soc);
9292

@@ -109,18 +109,18 @@ void initIO() {
109109
can = new CAN(PIN_CAN1_RD, PIN_CAN1_TD, CAN_FREQUENCY);
110110
can->filter(0x088, 0x00FF, CANAny); // accept any TPDOs from ACC (0x188, 0x288)
111111

112+
ThisThread::sleep_for(2500ms);
113+
112114
// LSS assign charger
113115
initChargerCAN();
114116

115-
this_thread::sleep_for(100ms);
117+
ThisThread::sleep_for(100ms);
116118
queue.call_every(100ms, &sendCAN);
117119
}
118120

119121
void initChargerCAN() {
120122
printf("initChargerCAN()\n");
121123

122-
ThisThread::sleep_for(2500ms);
123-
124124
// Switch state global protocol, switch to LSS configuration state
125125
uint8_t lss0_data[8] = {0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
126126
CANMessage lss0_msg(0x7E5, lss0_data);
@@ -169,4 +169,4 @@ void sendCAN() {
169169
CANMessage charge_control_msg(0x206, charge_control_data);
170170
can->write(charge_control_msg);
171171
ThisThread::sleep_for(1ms);
172-
}
172+
}

0 commit comments

Comments
 (0)