@@ -774,7 +774,6 @@ void Charger::run_state_machine() {
774774
775775 if (not shared_context.flag_transaction_active or not shared_context.flag_authorized or
776776 not shared_context.flag_ev_plugged_in ) {
777- EVLOG_warning << " going to stop from pause 1" ;
778777 set_state (EvseState::StoppingCharging);
779778 break ;
780779 }
@@ -805,11 +804,11 @@ void Charger::run_state_machine() {
805804 // be shut down before SessionStop.req)
806805
807806 if (shared_context.hlc_charging_terminate_pause == HlcTerminatePause::Terminate) {
808- // EV wants to terminate session. We still stay in PausedEV since it could restart a session as long as it is not unplugged.
807+ // EV wants to terminate session. We still stay in PausedEV since it could restart a session as long
808+ // as it is not unplugged.
809809 if (shared_context.pwm_running ) {
810810 pwm_off ();
811811 }
812-
813812 } else if (shared_context.hlc_charging_terminate_pause == HlcTerminatePause::Pause) {
814813 // EV wants an actual pause
815814 if (shared_context.pwm_running ) {
@@ -966,8 +965,6 @@ void Charger::run_state_machine() {
966965 bsp->allow_power_on (false , types::evse_board_support::Reason::PowerOff);
967966 }
968967
969- // FIXME: wait here for SLAC to become available again
970-
971968 // If unplugged, stop session and proceed to Idle, otherwise wait here and do nothing
972969 if (not shared_context.flag_ev_plugged_in ) {
973970 stop_session ();
@@ -1238,14 +1235,19 @@ bool Charger::set_max_current(float c, std::chrono::time_point<std::chrono::stea
12381235
12391236// set pausing flag, it will be picked up by the state machine.
12401237bool Charger::pause_charging () {
1241- shared_context.flag_paused_by_evse = true ;
1242- // FIXME: this now always works. Does this cause problems?
1243- return true ;
1238+ if (shared_context.flag_transaction_active ) {
1239+ shared_context.flag_paused_by_evse = true ;
1240+ return true ;
1241+ }
1242+ return false ;
12441243}
12451244
12461245bool Charger::resume_charging () {
1247- shared_context.flag_paused_by_evse = false ;
1248- // FIXME: this now always works. Does this cause problems?
1246+ if (shared_context.flag_transaction_active ) {
1247+ shared_context.flag_paused_by_evse = false ;
1248+ return true ;
1249+ }
1250+ return false ;
12491251 return true ;
12501252}
12511253
0 commit comments