Skip to content

Commit

Permalink
Merge branch 'june-2.4.1' into june-2.4.1-amm-ewa
Browse files Browse the repository at this point in the history
  • Loading branch information
dlyubimov committed Jul 3, 2017
2 parents e941499 + 4f7d133 commit bcaefd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Hydra_EVSE/Hydra_EVSE.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ struct car_struct {
void loopCheckPilot(unsigned int car_state);
void loopCurrentMonitor();
void loopCheckDelayedTransition();
void loopSeqHandover();
void loopSeqHandover(unsigned long nowMs);
// Inlines
char carLetter() { return 'A' + car - CAR_A; }
// Returns 0 for car A and 8 for car B. Typically, to print display status or current.
Expand Down
12 changes: 6 additions & 6 deletions Hydra_EVSE/Hydra_EVSE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2021,13 +2021,13 @@ void car_struct::loopCheckDelayedTransition() {

// This switches offer, sequential mode only, from a current car in mode B to the other car currently
// also in mode B, based on offer timeout.
void car_struct::loopSeqHandover() {
void car_struct::loopSeqHandover(unsigned long nowMs) {
{
logInfo(P("Sequential mode offer timeout, moving offer to %s"), car_str(CAR_B));
// move the pilot offer.
setPilot(HIGH);
them.setPilot(FULL);
sequential_pilot_timeout = now;
sequential_pilot_timeout = nowMs;
displayStatus(car | (seq_done ? STATUS_DONE : STATUS_WAIT));
// display.setCursor(0, 1);
// if ( seq_car_a_done )
Expand Down Expand Up @@ -2375,11 +2375,11 @@ void loop()

if (sequential_pilot_timeout != 0)
{
unsigned long now = millis();
if (now - sequential_pilot_timeout > SEQ_MODE_OFFER_TIMEOUT)
unsigned long nowMs = millis();
if (nowMs - sequential_pilot_timeout > SEQ_MODE_OFFER_TIMEOUT)
{
if (car_a.pilot_state == FULL)
car_a.loopSeqHandover();
car_a.loopSeqHandover(nowMs);
// {
// logInfo(P("Sequential mode offer timeout, moving offer to %s"), car_str(CAR_B));
// car_a.setPilot(HIGH);
Expand All @@ -2395,7 +2395,7 @@ void loop()
// // display.print(P("B: off "));
// }
else if (car_b.pilot_state == FULL)
car_b.loopSeqHandover();
car_b.loopSeqHandover(nowMs);
// {
// logInfo(P("Sequential mode offer timeout, moving offer to %s"), car_str(CAR_A));
// car_b.setPilot(HIGH);
Expand Down

0 comments on commit bcaefd2

Please sign in to comment.