Skip to content

Commit

Permalink
adding fifth event to switch off on weekdays at 2pm by default (PG&E …
Browse files Browse the repository at this point in the history
…end of partial peak time).
  • Loading branch information
dlyubimov committed Sep 1, 2017
1 parent d5d248a commit 42e9729
Show file tree
Hide file tree
Showing 4 changed files with 1,640 additions and 1,627 deletions.
8 changes: 4 additions & 4 deletions Hydra_EVSE/Hydra_EVSE.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "dst.h"

// SW version
#define SW_VERSION "2.4.1"
#define SW_VERSION "2.4.2-dev"

// Define this for the basic unit tests run in a generica arduino uno board with a display shield.
// #define UNIT_TESTS
Expand Down Expand Up @@ -422,7 +422,7 @@ struct car_struct {

};

#define EVENT_COUNT 4
#define EVENT_COUNT 5

typedef struct event_struct {
unsigned char hour;
Expand Down Expand Up @@ -486,8 +486,8 @@ typedef struct calib_struct {
// All the data that goes to be read/saved to eprom

// eprom persistence format signature (usually minimally compatible SW_VERSION):
// 2.4.1
#define PERSIST_SIG 2411
// 2.4.2-dev
#define PERSIST_SIG 2421

// debug to reset eprom
//#define PERSIST_SIG -1
Expand Down
8 changes: 7 additions & 1 deletion Hydra_EVSE/Hydra_EVSE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,13 @@ void persisted_struct::reset()

// Weekends: start at 7pm and pause (any day) on 3pm
events[2].dow_mask = ~weekdays; events[2].hour = 19;
events[3].dow_mask = -1u; events[3].hour = 15;
events[3].dow_mask = ~weekdays; events[3].hour = 15;

// On weekdays, we some times turn on during partial peek. The full peak on weekdays starts at 2pm,
// so we add a fifth event that switches the station off again at 2pm on weekdays in case we turned
// it on during partial peak.

events[4].dow_mask = weekdays; events[4].hour = 14;

calib.reset();
rtc.reset();
Expand Down
Loading

0 comments on commit 42e9729

Please sign in to comment.