Skip to content

Commit

Permalink
small-er bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
dlyubimov committed Jul 10, 2017
1 parent b65e52b commit 9efc7d7
Show file tree
Hide file tree
Showing 3 changed files with 1,561 additions and 1,481 deletions.
6 changes: 3 additions & 3 deletions Hydra_EVSE/Hydra_EVSE.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@
// delay per event. (UL 2231)
#define GFI_CLEAR_MS (15 * 60)
// debug
//#define GFI_CLEAR_MS (1 * 60)
//#define GFI_CLEAR_MS (2 * 60)

#define GFI_CLEAR_ATTEMPTS 4


Expand Down Expand Up @@ -488,7 +489,7 @@ typedef struct calib_struct {

// eprom persistence format signature (usually minimally compatible SW_VERSION):
// 2.4.1
#define PERSIST_SIG 241
#define PERSIST_SIG 2411

// debug to reset eprom
//#define PERSIST_SIG -1
Expand All @@ -501,7 +502,6 @@ struct persisted_struct {
unsigned char operatingMode;
unsigned int max_amps;
boolean enable_dst;
char rtc_cal;
event_struct events[EVENT_COUNT];
calib_struct calib;

Expand Down
5 changes: 3 additions & 2 deletions Hydra_EVSE/Hydra_EVSE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void persisted_struct::reset()

// By default, use the time zone for schedule.
enable_dst = true;
rtc_cal = 0;
// rtc_cal = 0;
for (int i = 0; i < EVENT_COUNT; i++) events[i].reset();

// Set up events hours according to PGE EV-A TOU schedule:
Expand All @@ -189,6 +189,7 @@ void persisted_struct::reset()
events[3].dow_mask = -1u; events[3].hour = 15;

calib.reset();
rtc.reset();
}

// persisted_struct implementation
Expand Down Expand Up @@ -1744,7 +1745,7 @@ void setup()
sequential_mode_tiebreak = DEFAULT_TIEBREAK;

setSyncProvider(RTC.get);
RTC.setCalibration(persisted.rtc_cal);
RTC.setCalibration(persisted.rtc.getCalib());

boolean success = SetPinFrequencySafe(CAR_A_PILOT_OUT_PIN, 1000);
if (!success)
Expand Down
Loading

0 comments on commit 9efc7d7

Please sign in to comment.