Skip to content

Commit

Permalink
v3.9.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
lincomatic committed Jun 6, 2015
1 parent c61bee3 commit 0e2f460
Show file tree
Hide file tree
Showing 10 changed files with 187 additions and 267 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Change Log

SCL20150605
-> promote to v3.9.0 in stable branch

vD3.9.0 SCL 20150604
vD3.9.0 SCL 20150604-5
- split out Gfi/J1772Pilot/J1772EvseController into separate files
- add support for changing I2C frequency
- increase I2C bus from 100KHz -> 200KHz
Expand All @@ -21,6 +23,13 @@ vD3.9.0 SCL 20150604
EVSE in Sleep state
- send $WF WIFI_MODE_AP_DEFAULT instead of WIFI_MODE_AP to client on very long
button press
- fix RAPI bug: $GF was returning FF as trip counts if zero. New max value for
any trip count = FE
- fix documentation for $SC & $GG
- got rid of superfluous AUTOSTART_MENU and MANUALSTART code
- fixes for TEMPERATURE_MONITORING from CraigK
- fix bugs in Charging screen when KWH_RECORDING or TEMPERATURE_MONITORING not defined


v3.8.4 SCL 20150526
-> pushed to stable branch
Expand Down
57 changes: 28 additions & 29 deletions J1772EvseController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
*/
#include "open_evse.h"


#ifdef FT_ENDURANCE
int g_CycleCnt = -1;
long g_CycleHalfStart;
uint8_t g_CycleState;
#endif

THRESH_DATA g_DefaultThreshData = {875,780,690,0,260};

Expand Down Expand Up @@ -354,19 +358,6 @@ void J1772EVSEController::EnableAutoSvcLevel(uint8_t tf)

#endif // ADVPWR

// Functions to support Auto Start feature - GoldServe
#ifdef MANUALSTART
void J1772EVSEController::EnableAutoStart(uint8_t tf)
{
if (tf) {
m_wFlags &= ~ECF_AUTO_START_DISABLED;
}
else {
m_wFlags |= ECF_AUTO_START_DISABLED;
}
SaveEvseFlags();
}
#endif //#ifdef MANUALSTART
void J1772EVSEController::EnableSerDbg(uint8_t tf)
{
if (tf) {
Expand Down Expand Up @@ -902,15 +893,11 @@ void J1772EVSEController::Init()

SetSvcLevel(svclvl);

// Start Manual Start Feature - GoldServe
#ifdef MANUALSTART
if (AutoStartEnabled()){
Enable();
} else {
#ifdef DELAYTIMER
if (g_DelayTimer.IsTimerEnabled()) {
Sleep();
}
#endif //#ifdef MANUALSTART
// End Manual Start Feature - GoldServe
#endif

g_OBD.SetGreenLed(0);
}
Expand Down Expand Up @@ -993,7 +980,7 @@ void J1772EVSEController::Update()

chargingOff(); // open the relay

if ((prevevsestate != EVSE_STATE_NO_GROUND) && (m_NoGndTripCnt < 254)) {
if ((prevevsestate != EVSE_STATE_NO_GROUND) && (m_NoGndTripCnt < 253)) {
m_NoGndTripCnt++;
eeprom_write_byte((uint8_t*)EOFS_NOGND_TRIP_CNT,m_NoGndTripCnt);
}
Expand Down Expand Up @@ -1043,7 +1030,7 @@ void J1772EVSEController::Update()
((curms - m_StuckRelayStartTimeMS) > STUCK_RELAY_DELAY) ) || // start delay de-bounce
(prevevsestate == EVSE_STATE_STUCK_RELAY) ) { // already in error state
// stuck relay
if ((prevevsestate != EVSE_STATE_STUCK_RELAY) && (m_StuckRelayTripCnt < 254)) {
if ((prevevsestate != EVSE_STATE_STUCK_RELAY) && (m_StuckRelayTripCnt < 253)) {
m_StuckRelayTripCnt++;
eeprom_write_byte((uint8_t*)EOFS_STUCK_RELAY_TRIP_CNT,m_StuckRelayTripCnt);
}
Expand All @@ -1063,7 +1050,7 @@ void J1772EVSEController::Update()
m_EvseState = EVSE_STATE_GFCI_FAULT;

if (prevevsestate != EVSE_STATE_GFCI_FAULT) { // state transition
if (m_GfiTripCnt < 254) {
if (m_GfiTripCnt < 253) {
m_GfiTripCnt++;
eeprom_write_byte((uint8_t*)EOFS_GFI_TRIP_CNT,m_GfiTripCnt);
}
Expand Down Expand Up @@ -1367,36 +1354,48 @@ void J1772EVSEController::Update()

#ifdef TEMPERATURE_MONITORING
if (m_ElapsedChargeTime != m_ElapsedChargeTimePrev) {
uint8_t currcap = eeprom_read_byte((uint8_t*) ((GetCurSvcLevel() == 2) ? EOFS_CURRENT_CAPACITY_L2 : EOFS_CURRENT_CAPACITY_L1));
uint8_t setit = 0;
g_TempMonitor.Read();
if (!g_TempMonitor.OverTemperature() && ((g_TempMonitor.m_TMP007_temperature >= TEMPERATURE_INFRARED_THROTTLE_DOWN ) || // any sensor reaching threshold trips action
(g_TempMonitor.m_MCP9808_temperature >= TEMPERATURE_AMBIENT_THROTTLE_DOWN ) ||
(g_TempMonitor.m_DS3231_temperature >= TEMPERATURE_AMBIENT_THROTTLE_DOWN ))) { // Throttle back the L2 current advice to the EV
g_TempMonitor.SetOverTemperature(1);
SetCurrentCapacity(g_TempMonitor.m_ampacity / 2,0,1); // set L2 to the throttled back level
currcap /= 2; // set to the throttled back level
setit = 1;
}

if (g_TempMonitor.OverTemperature() && ((g_TempMonitor.m_TMP007_temperature <= TEMPERATURE_INFRARED_RESTORE_AMPERAGE ) && // all sensors need to show return to lower levels
(g_TempMonitor.m_MCP9808_temperature <= TEMPERATURE_AMBIENT_RESTORE_AMPERAGE ) &&
(g_TempMonitor.m_DS3231_temperature <= TEMPERATURE_AMBIENT_RESTORE_AMPERAGE ))) { // restore the original L2 current advice to the EV
g_TempMonitor.SetOverTemperature(0);
SetCurrentCapacity(g_TempMonitor.m_ampacity,0,1); // set L2 to the user's original setting for L2 current

setit = 1; // set to the user's original setting for current
}


if (!g_TempMonitor.OverTemperatureShutdown() && ((g_TempMonitor.m_TMP007_temperature >= TEMPERATURE_INFRARED_SHUTDOWN ) || // any sensor reaching threshold trips action
(g_TempMonitor.m_MCP9808_temperature >= TEMPERATURE_AMBIENT_SHUTDOWN ) ||
(g_TempMonitor.m_DS3231_temperature >= TEMPERATURE_AMBIENT_SHUTDOWN ))) { // Throttle back the L2 current advice to the EV
g_TempMonitor.SetOverTemperatureShutdown(1);
SetCurrentCapacity(g_TempMonitor.m_ampacity / 4,0,1);
currcap /= 4;
setit = 1;
}

if (g_TempMonitor.OverTemperatureShutdown() && ((g_TempMonitor.m_TMP007_temperature <= TEMPERATURE_INFRARED_THROTTLE_DOWN ) && // all sensors need to show return to lower levels
(g_TempMonitor.m_MCP9808_temperature <= TEMPERATURE_AMBIENT_THROTTLE_DOWN ) &&
(g_TempMonitor.m_DS3231_temperature <= TEMPERATURE_AMBIENT_THROTTLE_DOWN ))) { // restore the throttled down current advice to the EV since things have cooled down again
g_TempMonitor.SetOverTemperatureShutdown(0);
SetCurrentCapacity(g_TempMonitor.m_ampacity / 2,0,1); // set L2 to the throttled back level
m_Pilot.SetPWM(m_CurrentCapacity);

currcap /= 2; // set to the throttled back level
setit = 1;
}
if (setit) {
SetCurrentCapacity(currcap,0,1);
if (m_Pilot.GetState() != PILOT_STATE_PWM) {
m_Pilot.SetPWM(m_CurrentCapacity);
}
}
}
#endif // TEMPERATURE_MONITORING
#ifdef CHARGE_LIMIT
Expand Down
18 changes: 11 additions & 7 deletions J1772EvseController.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ class J1772EVSEController {
#ifdef GFI
void SetGfiTripped();
uint8_t GfiTripped() { return m_bVFlags & ECVF_GFI_TRIPPED; }
uint8_t GetGfiTripCnt() { return m_GfiTripCnt; }
#ifdef GFI_SELFTEST
uint8_t GfiSelfTestEnabled() {
return (m_wFlags & ECF_GFI_TEST_DISABLED) ? 0 : 1;
Expand All @@ -283,13 +284,6 @@ class J1772EVSEController {
uint8_t SerDbgEnabled() {
return (m_wFlags & ECF_SERIAL_DBG) ? 1 : 0;
}
// Function to suppport Auto Start feature - GoldServe
#ifdef MANUALSTART
void EnableAutoStart(uint8_t tf);
uint8_t AutoStartEnabled() {
return (m_wFlags & ECF_AUTO_START_DISABLED) ? 0 : 1;
}
#endif //ifdef MANUALSTART
void EnableSerDbg(uint8_t tf);
#ifdef RGBLCD
int SetBacklightType(uint8_t t,uint8_t update=1); // BKL_TYPE_XXX
Expand Down Expand Up @@ -344,6 +338,16 @@ class J1772EVSEController {
#ifdef SHOW_DISABLED_TESTS
void ShowDisabledTests();
#endif
#ifdef ADVPWR
uint8_t GetNoGndTripCnt() { return m_NoGndTripCnt; }
uint8_t GetStuckRelayTripCnt() { return m_StuckRelayTripCnt; }
#endif // ADVPWR
};

#ifdef FT_ENDURANCE
extern int g_CycleCnt;
extern long g_CycleHalfStart;
extern uint8_t g_CycleState;
#endif

extern J1772EVSEController g_EvseController;
31 changes: 7 additions & 24 deletions open_evse.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,16 @@
#define GFI_SELFTEST
#endif //UL_GFI_SELFTEST


// Temperature monitoring support // comment out both TEMPERATURE_MONITORING and KWH_RECORDING to have the elapsed time and time of day displayed on the second line of the LCD
#define TEMPERATURE_MONITORING
#define TEMPERATURE_MONITORING // Temperature monitoring support

#ifdef AMMETER
// kWh Recording feature depends upon #AMMETER support
// comment out KWH_RECORDING to have the elapsed time and time of day displayed on the second line of the LCD
#define KWH_RECORDING
#ifdef KWH_RECORDING
// stop charging after a certain kWh reached
#define CHARGE_LIMIT
#endif // KWH_RECORDING
#endif //AMMETER

//Adafruit RGBLCD (MCP23017) - can have RGB or monochrome backlight
Expand Down Expand Up @@ -162,19 +163,10 @@
// Option for Delay Timer - GoldServe
#define DELAYTIMER

// Option for AutoStart Menu. If defined, ManualStart feature is also defined by default - GoldServe
//#define AUTOSTART_MENU

#if defined(DELAYTIMER) && defined(BTN_MENU)
#define DELAYTIMER_MENU
#endif

// AutoStart feature must be defined if Delay Timers are used - GoldServe
#if defined(DELAYTIMER)||defined(AUTOSTART_MENU)
// Option for AutoStart Enable/Disable - GoldServe
#define MANUALSTART
#endif

#endif // RTC

// if defined, this pin goes HIGH when the EVSE is sleeping, and LOW otherwise
Expand Down Expand Up @@ -750,8 +742,6 @@ class TempMonitor {
#ifdef TMP007_IS_ON_I2C
Adafruit_TMP007 m_tmp007;
#endif //TMP007_IS_ON_I2C

uint8_t m_ampacity; // using this to keep track of the user's original ampacity to restore after temperature monitoring has throttled it to a lower value
// these three temperatures need to be signed integers
int16_t m_MCP9808_temperature; // 230 means 23.0C Using an integer to save on floating point library use
int16_t m_DS3231_temperature; // the DS3231 RTC has a built in temperature sensor
Expand Down Expand Up @@ -923,16 +913,6 @@ class BklTypeMenu : public Menu {
};
#endif // RGBLCD

#ifdef AUTOSTART_MENU
class AutoStartMenu : public Menu {
public:
AutoStartMenu();
void Init();
void Next();
Menu *Select();
};
#endif //#ifdef AUTOSTART_MENU

#if defined(DELAYTIMER)
class RTCMenu : public Menu {
public:
Expand Down Expand Up @@ -1139,6 +1119,9 @@ extern char g_sSpace[];
#define g_sSpace " "


#ifdef DELAYTIMER
extern DelayTimer g_DelayTimer;
#endif
#ifdef BTN_MENU
extern BtnHandler g_BtnHandler;
extern SettingsMenu g_SettingsMenu;
Expand Down
Loading

0 comments on commit 0e2f460

Please sign in to comment.