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

Heater #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions firmware/heater_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ HeaterState HeaterControllerBase::GetNextState(HeaterState currentState, HeaterA

if (!heaterAllowed)
{
// if heater voltage too low to start pre-heat
if (batteryVoltage < HEATER_BATTETY_OFF_VOLTAGE)
{
SetFault(ch, Fault::SensorNoHeatSupply);
return HeaterState::NoHeaterSupply;
Copy link
Owner

Choose a reason for hiding this comment

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

this code is unreachable because of line 51, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dron0gus I've just rebased this old PR but do we still need it at all?

Copy link
Owner

Choose a reason for hiding this comment

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

This maybe gets replaced by #292 with the addition of the SetFault(...) call near line 51

}
SetFault(ch, Fault::None);
// ECU hasn't allowed preheat yet, reset timer, and force preheat state
m_preheatTimer.reset();
return HeaterState::Preheat;
Expand Down