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

Fixing issue where the port wouldn't unlock in the case when AC charg… #44

Merged
merged 1 commit into from
Nov 18, 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
17 changes: 17 additions & 0 deletions ccs/acOBC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,23 @@ static void triggerActions()
- Button?
- What if DutyCycle goes away? (e.g. PV charging turning off over night)
- What if proximity goes away? (e.g. no lock installed) */

uint8_t cpDuty_Percent = (uint8_t)Param::GetFloat(Param::ControlPilotDuty);
if(cpDuty_Percent<3)
{
Param::SetInt(Param::PortState,0x1); //set PortState to Plugged In due to dropping way of valid CP - !!!Should not interfere with CCS charging
if (Param::GetInt(Param::LockState) == LOCK_CLOSED && Param::GetInt(Param::AllowUnlock) == 1)//only unlock if allowed and lock is locked
{
if(Param::GetInt(Param::ActuatorTest) == 0)
{
hardwareInterface_triggerConnectorUnlocking();
}
}
}
else if(Param::GetFloat(Param::CableCurrentLimit) < 1)
{
Param::SetInt(Param::PortState,0x0); //set PortState to Idle NO PP or CP present thus unplugged
}
}
}

Expand Down