Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix legacy wakeup for PWM charging #845

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion modules/EvseManager/IECStateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ std::queue<CPEvent> IECStateMachine::state_machine() {
if (pwm_running) { // C2
// 1) When we come from state B: switch on if we are allowed to
// 2) When we are in C2 for a while now and finally get a delayed power_on_allowed: also switch on

if (power_on_allowed && (!last_power_on_allowed || last_cp_state == RawCPState::B)) {
// Table A.6: Sequence 4 EV ready to charge.
// Must enable power within 3 seconds.
Expand Down Expand Up @@ -293,7 +294,9 @@ std::queue<CPEvent> IECStateMachine::state_machine() {
connector_unlock();
timer = TimerControl::stop;
call_allow_power_on_bsp(false);
pwm_running = false;
if (last_cp_state not_eq RawCPState::F) {
pwm_running = false;
}
if (last_cp_state == RawCPState::B || last_cp_state == RawCPState::C || last_cp_state == RawCPState::D) {
events.push(CPEvent::BCDtoEF);
}
Expand Down Expand Up @@ -372,6 +375,7 @@ void IECStateMachine::set_pwm_F() {

// The higher level state machine in Charger.cpp calls this to indicate it allows contactors to be switched on
void IECStateMachine::allow_power_on(bool value, types::evse_board_support::Reason reason) {
EVLOG_info << "Allow power on: " << value << " Reason: " << reason;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that log message desired here or left over from debugging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is desired

{
Everest::scoped_lock_timeout lock(state_machine_mutex, Everest::MutexDescription::IEC_allow_power_on);
// Only set the flags here in case of power on.
Expand Down
Loading