Skip to content

Commit 964178c

Browse files
committed
v3.10.4
2 parents ebfd94e + d59c333 commit 964178c

22 files changed

+2309
-245
lines changed

Adafruit_TMP007.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Adafruit_TMP007::Adafruit_TMP007(uint8_t i2caddr) {
2525
}
2626

2727

28-
boolean Adafruit_TMP007::begin(uint8_t samplerate) {
28+
boolean Adafruit_TMP007::begin(uint16_t samplerate) {
2929
//don't need - open_evse.ino does it Wire.begin();
3030

3131
write16(TMP007_CONFIG, TMP007_CFG_MODEON | TMP007_CFG_ALERTEN |

Adafruit_TMP007.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
class Adafruit_TMP007 {
5555
public:
5656
Adafruit_TMP007(uint8_t addr = TMP007_I2CADDR);
57-
boolean begin(uint8_t samplerate = TMP007_CFG_4SAMPLE); // by default go to once per second
57+
boolean begin(uint16_t samplerate = TMP007_CFG_4SAMPLE); // by default go to once per second
5858

5959
int16_t readRawDieTemperature(void);
6060
int16_t readRawVoltage(void);

CHANGELOG

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,93 @@
11
Change Log
22

3+
SC: 20151011
4+
v3.10.4
5+
- vD3.10.4 promoted to stable
6+
7+
vD3.10.4 SCL 20151110
8+
- update version number
9+
10+
SCL 20151022
11+
- added SERDBG - decouple serial diags from SERIALCLI
12+
13+
SCL 20151019
14+
- slight tweak to RTClib.cpp compiler warning fix in 3.10.2
15+
16+
vD3.10.3 CWK 20151018
17+
- Correcting accumulating kWh and resetting Wh going in and out of sleep state
18+
19+
vD3.10.2 SCL 20151017
20+
- lots of changes to get rid of 1.6.5 compiler warnings(More)
21+
- wmcbrine PR 48: more code shrinking from - manually merged
22+
23+
vD3.10.1 SCL 20151017
24+
- merge PR 47 from wmcbrine
25+
- faster ulong_sqrt()
26+
- code saving tweaks to u2a() & SaveSettings()
27+
28+
vD3.10.0 SCL 20151017
29+
- fix compile error caused by include for LiquidCrystal_I2C.h
30+
31+
vD3.10.0 SCL 20151012
32+
- fix bug introduced by diode check state oscillation fix in D3.9.9 - if
33+
transition to sleep while charging, on sleep exit would go into VENT REQ error
34+
-> if pilot voltage in State C range, but PWM off, go to State B
35+
this is an added safety feature, because State C should never be allowed
36+
when PWM is off
37+
- fix bug: if enter sleep mode due to time/charge limit met, sleep should
38+
automatically be cancelled when car disconnected but it was staying in sleep
39+
40+
vD3.9.10 CWK 20150920
41+
- GFI Self Test Duty Cylce restored to 50%
42+
43+
vD3.9.9 CWK/SCL 20150914
44+
- fix diode check state oscillation bug (cwk/scl)
45+
- hard fault on vent required (scl)
46+
- setup() - increase I2C device delay from 200 -> 400ms (cwk) for Danny ter Haars board
47+
- code cleanup of temperature monitoring to save 62 bytes
48+
49+
vD3.9.8 CWK 20150912
50+
- fix Temperature Monitoring, broken by accident in D3.9.5
51+
The original users amperage level is restored properly after an event.
52+
53+
vD3.9.7 SCL 20150905
54+
- raise OpenEVSE temperature thresholds +10C to match OE-II
55+
56+
SCL 20150905
57+
- fix compile error when AMMETER disabled
58+
59+
vD3.9.6 SCL 20150818
60+
- for OpenEVSE II, bump up TEMPERATURE_AMBIENT_xxx by 10 due to extra headroom of CUI VSK-S3-12U power supply
61+
62+
vD3.9.5 SCL 20150722
63+
- merge changes from temp branch:
64+
1. EVSE goes to sleep after time/charge limit met.. would stay in sleep
65+
-> automatically cancel sleep mode when car disconnected *only if* the
66+
sleep was induced by time/charge limit
67+
2. decouple temperature monitoring from J1772EVSEController::Update()
68+
-> so that temperature is still monitored when EVSE disabled/sleeping
69+
3. ProcessInputs() removed from J1772EVSEController
70+
4. added TEMPERATURE_MONITORING_NY (not yet) code .. currently disabled
71+
-> $GO/$SO RAPI
72+
-> added ambient/ir_thresh support
73+
74+
vD3.9.4 SCL 20150611
75+
- reduce GFI self test pulse duration from 50% to 33%
76+
77+
vD3.9.3.1 SCL 20150611
78+
- craigK PR #46
79+
80+
vD3.9.3 SCL 20150608
81+
- add files and edits to restore I2CLCD_PCF8574 build capability
82+
- broken DelayTimer() introduced in 3.9.0
83+
84+
vD3.9.2 SCL 20150606
85+
- fix $GF bug
86+
87+
vD3.9.1 SCL 20150605
88+
- boost I2C bus to 400KHz
89+
90+
391
SCL20150605
492
-> promote to v3.9.0 in stable branch
593
Many thanks to CraigK for his numerous contributions and top notch testing.

Gfi.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,11 @@ uint8_t Gfi::SelfTest()
6060
{
6161
testInProgress = 1;
6262
testSuccess = 0;
63-
for(int i=0; i < GFI_TEST_CYCLES; i++) {
63+
for(int i=0; !testSuccess && (i < GFI_TEST_CYCLES); i++) {
6464
pinTest.write(1);
65-
delayMicroseconds(GFI_PULSE_DURATION_US);
65+
delayMicroseconds(GFI_PULSE_ON_US);
6666
pinTest.write(0);
67-
delayMicroseconds(GFI_PULSE_DURATION_US);
68-
if (testSuccess) break; // no need to keep trying.
67+
delayMicroseconds(GFI_PULSE_OFF_US);
6968
}
7069

7170
// wait for GFI pin to clear

I2CIO.cpp

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
// ---------------------------------------------------------------------------
2+
// Created by Francisco Malpartida on 20/08/11.
3+
// Copyright 2011 - Under creative commons license 3.0:
4+
// Attribution-ShareAlike CC BY-SA
5+
//
6+
// This software is furnished "as is", without technical support, and with no
7+
// warranty, express or implied, as to its usefulness for any purpose.
8+
//
9+
// Thread Safe: No
10+
// Extendable: Yes
11+
//
12+
// @file I2CIO.h
13+
// This file implements a basic IO library using the PCF8574 I2C IO Expander
14+
// chip.
15+
//
16+
// @brief
17+
// Implement a basic IO library to drive the PCF8574* I2C IO Expander ASIC.
18+
// The library implements basic IO general methods to configure IO pin direction
19+
// read and write uint8_t operations and basic pin level routines to set or read
20+
// a particular IO port.
21+
//
22+
//
23+
// @version API 1.0.0
24+
//
25+
// @author F. Malpartida - fmalpartida@gmail.com
26+
// ---------------------------------------------------------------------------
27+
#if (ARDUINO < 100)
28+
#include <WProgram.h>
29+
#else
30+
#include <Arduino.h>
31+
#endif
32+
33+
#include <inttypes.h>
34+
35+
#include "./Wire.h"
36+
#include "./I2CIO.h"
37+
38+
// CLASS VARIABLES
39+
// ---------------------------------------------------------------------------
40+
41+
42+
// CONSTRUCTOR
43+
// ---------------------------------------------------------------------------
44+
I2CIO::I2CIO ( )
45+
{
46+
_i2cAddr = 0x0;
47+
_dirMask = 0xFF; // mark all as INPUTs
48+
_shadow = 0x0; // no values set
49+
_initialised = false;
50+
}
51+
52+
// PUBLIC METHODS
53+
// ---------------------------------------------------------------------------
54+
55+
//
56+
// begin
57+
int I2CIO::begin ( uint8_t i2cAddr )
58+
{
59+
_i2cAddr = i2cAddr;
60+
61+
Wire.begin ( );
62+
63+
_initialised = Wire.requestFrom ( _i2cAddr, (uint8_t)1 );
64+
65+
#if (ARDUINO < 100)
66+
_shadow = Wire.receive ();
67+
#else
68+
_shadow = Wire.read (); // Remove the byte read don't need it.
69+
#endif
70+
71+
return ( _initialised );
72+
}
73+
74+
//
75+
// pinMode
76+
void I2CIO::pinMode ( uint8_t pin, uint8_t dir )
77+
{
78+
if ( _initialised )
79+
{
80+
if ( OUTPUT == dir )
81+
{
82+
_dirMask &= ~( 1 << pin );
83+
}
84+
else
85+
{
86+
_dirMask |= ( 1 << pin );
87+
}
88+
}
89+
}
90+
91+
//
92+
// portMode
93+
void I2CIO::portMode ( uint8_t dir )
94+
{
95+
96+
if ( _initialised )
97+
{
98+
if ( dir == INPUT )
99+
{
100+
_dirMask = 0xFF;
101+
}
102+
else
103+
{
104+
_dirMask = 0x00;
105+
}
106+
}
107+
}
108+
109+
//
110+
// read
111+
uint8_t I2CIO::read ( void )
112+
{
113+
uint8_t retVal = 0;
114+
115+
if ( _initialised )
116+
{
117+
Wire.requestFrom ( _i2cAddr, (uint8_t)1 );
118+
#if (ARDUINO < 100)
119+
retVal = ( _dirMask & Wire.receive ( ) );
120+
#else
121+
retVal = ( _dirMask & Wire.read ( ) );
122+
#endif
123+
124+
}
125+
return ( retVal );
126+
}
127+
128+
//
129+
// write
130+
int I2CIO::write ( uint8_t value )
131+
{
132+
int status = 0;
133+
134+
if ( _initialised )
135+
{
136+
// Only write HIGH the values of the ports that have been initialised as
137+
// outputs updating the output shadow of the device
138+
_shadow = ( value & ~(_dirMask) );
139+
140+
Wire.beginTransmission ( _i2cAddr );
141+
#if (ARDUINO < 100)
142+
Wire.send ( _shadow );
143+
#else
144+
Wire.write ( _shadow );
145+
#endif
146+
status = Wire.endTransmission ();
147+
}
148+
return ( (status == 0) );
149+
}
150+
151+
//
152+
// digitalRead
153+
uint8_t I2CIO::digitalRead ( uint8_t pin )
154+
{
155+
uint8_t pinVal = 0;
156+
157+
// Check if initialised and that the pin is within range of the device
158+
// -------------------------------------------------------------------
159+
if ( ( _initialised ) && ( pin <= 7 ) )
160+
{
161+
// Remove the values which are not inputs and get the value of the pin
162+
pinVal = this->read() & _dirMask;
163+
pinVal = ( pinVal >> pin ) & 0x01; // Get the pin value
164+
}
165+
return (pinVal);
166+
}
167+
168+
//
169+
// digitalWrite
170+
int I2CIO::digitalWrite ( uint8_t pin, uint8_t level )
171+
{
172+
uint8_t writeVal;
173+
int status = 0;
174+
175+
// Check if initialised and that the pin is within range of the device
176+
// -------------------------------------------------------------------
177+
if ( ( _initialised ) && ( pin <= 7 ) )
178+
{
179+
// Only write to HIGH the port if the port has been configured as
180+
// an OUTPUT pin. Add the new state of the pin to the shadow
181+
writeVal = ( 1 << pin ) & ~_dirMask;
182+
if ( level == HIGH )
183+
{
184+
_shadow |= writeVal;
185+
186+
}
187+
else
188+
{
189+
_shadow &= ~writeVal;
190+
}
191+
status = this->write ( _shadow );
192+
}
193+
return ( status );
194+
}
195+
196+
//
197+
// PRIVATE METHODS
198+
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)