Skip to content

Commit

Permalink
don't allow SetCurrentCapacity() above PP max
Browse files Browse the repository at this point in the history
  • Loading branch information
lincomatic committed May 18, 2018
1 parent d71926e commit 1c51eea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions firmware/open_evse/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Change Log
-> don't allow $SC with V to raise current capacity above value in EEPROM
-> don't allow PP to set current capacity higher than EEPROM
- PP code cleanup
- don't allow SetCurrentCapacity() to go above PP value

20180417 SCL
- fix compile errors when no GFI and ADVPWR. Must also undef UL_COMPLIANT,
Expand Down
9 changes: 9 additions & 0 deletions firmware/open_evse/J1772EvseController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,15 @@ int J1772EVSEController::SetCurrentCapacity(uint8_t amps,uint8_t updatelcd,uint8
maxcurrentcap = GetMaxCurrentCapacity();
}

#ifdef PP_AUTO_AMPACITY
if ((GetState() >= EVSE_STATE_B) && (GetState() <= EVSE_STATE_C)) {
uint8_t mcc = g_ACCController.ReadPPMaxAmps();
if (mcc && (mcc < maxcurrentcap)) {
maxcurrentcap = mcc;
}
}
#endif // PP_AUTO_AMPACITY

if ((amps >= MIN_CURRENT_CAPACITY_J1772) && (amps <= maxcurrentcap)) {
m_CurrentCapacity = amps;
}
Expand Down

0 comments on commit 1c51eea

Please sign in to comment.