Skip to content

Commit

Permalink
fix OpenEVSE#517: do not set Scheduler claim if evse module communica…
Browse files Browse the repository at this point in the history
…tion is not ready
  • Loading branch information
KipK committed Jan 16, 2023
1 parent 41376f2 commit 4968cf4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,12 @@ unsigned long Scheduler::loop(MicroTasks::WakeReason reason)
if(EvseState::Active == currentEvent.getState())
{
priority = EvseManager_Priority_Timer;
properties.setChargeCurrent(_evse->getMaxHardwareCurrent());
uint8_t evseMaxCurrent = _evse->getMaxHardwareCurrent();
if (!evseMaxCurrent) {
// evse not ready, retry in 1 sec
return 1000;
}
properties.setChargeCurrent(evseMaxCurrent);
}
_evse->claim(EvseClient_OpenEVSE_Schedule, priority, properties);
} else {
Expand Down

0 comments on commit 4968cf4

Please sign in to comment.