Skip to content

Commit

Permalink
Merge branch 'main' into feature/update-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
hikinggrass authored Jun 26, 2024
2 parents 1ca958b + 7b54f73 commit 6dcd246
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/EvseManager/EvseManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ void EvseManager::ready() {

// start with a limit of 0 amps. We will get a budget from EnergyManager that is locally limited by hw
// caps.
charger->set_max_current(0.0F, date::utc_clock::now() + std::chrono::seconds(10));
charger->set_max_current(0.0F, date::utc_clock::now() + std::chrono::seconds(120));
this->p_evse->publish_waiting_for_external_ready(config.external_ready_to_start_charging);
if (not config.external_ready_to_start_charging) {
// immediately ready, otherwise delay until we get the external signal
Expand Down
12 changes: 9 additions & 3 deletions modules/YetiDriver/board_support/evse_board_supportImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ void evse_board_supportImpl::init() {
mod->serial.signalCPState.connect([this](CpState cp_state) {
if (cp_state not_eq last_cp_state) {
auto event_cp_state = cast_event_type(cp_state);
EVLOG_info << "CP state changed: " << types::board_support_common::event_to_string(event_cp_state.event);
publish_event(event_cp_state);
EVLOG_info << "CP state changed: "
<< types::board_support_common::event_to_string(cast_event_type(last_cp_state).event) << " -> "
<< types::board_support_common::event_to_string(event_cp_state.event);
if (enabled) {
publish_event(event_cp_state);
}

if (cp_state == CpState_STATE_A) {
mod->clear_errors_on_unplug();
Expand Down Expand Up @@ -192,7 +196,9 @@ void evse_board_supportImpl::handle_evse_replug(int& value) {
}

void evse_board_supportImpl::handle_enable(bool& value) {
// Query CP state once and publish
enabled = true;
// Publish CP state once on enable
publish_event(cast_event_type(last_cp_state));
}

void evse_board_supportImpl::handle_setup(bool& three_phases, bool& has_ventilation, std::string& country_code) {
Expand Down
3 changes: 2 additions & 1 deletion modules/YetiDriver/board_support/evse_board_supportImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ class evse_board_supportImpl : public evse_board_supportImplBase {
types::evse_board_support::HardwareCapabilities caps;
std::atomic_bool caps_received{false};
std::mutex capsMutex;
CpState last_cp_state{CpState::CpState_STATE_E};
CpState last_cp_state{CpState::CpState_STATE_F};
bool last_relais_state{false};
types::board_support_common::ProximityPilot last_pp{types::board_support_common::Ampacity::None};
void wait_for_caps();
std::atomic_bool enabled{false};
// ev@3370e4dd-95f4-47a9-aaec-ea76f34a66c9:v1
};

Expand Down

0 comments on commit 6dcd246

Please sign in to comment.