diff --git a/firmware/open_evse/CHANGELOG b/firmware/open_evse/CHANGELOG index 02cfd7e4..d7e4527f 100644 --- a/firmware/open_evse/CHANGELOG +++ b/firmware/open_evse/CHANGELOG @@ -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, diff --git a/firmware/open_evse/J1772EvseController.cpp b/firmware/open_evse/J1772EvseController.cpp index 6862b871..aa83f3c8 100644 --- a/firmware/open_evse/J1772EvseController.cpp +++ b/firmware/open_evse/J1772EvseController.cpp @@ -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; }