Skip to content

Commit

Permalink
v3.10.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lincomatic committed Nov 10, 2015
2 parents ebfd94e + d59c333 commit 964178c
Show file tree
Hide file tree
Showing 22 changed files with 2,309 additions and 245 deletions.
2 changes: 1 addition & 1 deletion Adafruit_TMP007.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Adafruit_TMP007::Adafruit_TMP007(uint8_t i2caddr) {
}


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

write16(TMP007_CONFIG, TMP007_CFG_MODEON | TMP007_CFG_ALERTEN |
Expand Down
2 changes: 1 addition & 1 deletion Adafruit_TMP007.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
class Adafruit_TMP007 {
public:
Adafruit_TMP007(uint8_t addr = TMP007_I2CADDR);
boolean begin(uint8_t samplerate = TMP007_CFG_4SAMPLE); // by default go to once per second
boolean begin(uint16_t samplerate = TMP007_CFG_4SAMPLE); // by default go to once per second

int16_t readRawDieTemperature(void);
int16_t readRawVoltage(void);
Expand Down
88 changes: 88 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,93 @@
Change Log

SC: 20151011
v3.10.4
- vD3.10.4 promoted to stable

vD3.10.4 SCL 20151110
- update version number

SCL 20151022
- added SERDBG - decouple serial diags from SERIALCLI

SCL 20151019
- slight tweak to RTClib.cpp compiler warning fix in 3.10.2

vD3.10.3 CWK 20151018
- Correcting accumulating kWh and resetting Wh going in and out of sleep state

vD3.10.2 SCL 20151017
- lots of changes to get rid of 1.6.5 compiler warnings(More)
- wmcbrine PR 48: more code shrinking from - manually merged

vD3.10.1 SCL 20151017
- merge PR 47 from wmcbrine
- faster ulong_sqrt()
- code saving tweaks to u2a() & SaveSettings()

vD3.10.0 SCL 20151017
- fix compile error caused by include for LiquidCrystal_I2C.h

vD3.10.0 SCL 20151012
- fix bug introduced by diode check state oscillation fix in D3.9.9 - if
transition to sleep while charging, on sleep exit would go into VENT REQ error
-> if pilot voltage in State C range, but PWM off, go to State B
this is an added safety feature, because State C should never be allowed
when PWM is off
- fix bug: if enter sleep mode due to time/charge limit met, sleep should
automatically be cancelled when car disconnected but it was staying in sleep

vD3.9.10 CWK 20150920
- GFI Self Test Duty Cylce restored to 50%

vD3.9.9 CWK/SCL 20150914
- fix diode check state oscillation bug (cwk/scl)
- hard fault on vent required (scl)
- setup() - increase I2C device delay from 200 -> 400ms (cwk) for Danny ter Haars board
- code cleanup of temperature monitoring to save 62 bytes

vD3.9.8 CWK 20150912
- fix Temperature Monitoring, broken by accident in D3.9.5
The original users amperage level is restored properly after an event.

vD3.9.7 SCL 20150905
- raise OpenEVSE temperature thresholds +10C to match OE-II

SCL 20150905
- fix compile error when AMMETER disabled

vD3.9.6 SCL 20150818
- for OpenEVSE II, bump up TEMPERATURE_AMBIENT_xxx by 10 due to extra headroom of CUI VSK-S3-12U power supply

vD3.9.5 SCL 20150722
- merge changes from temp branch:
1. EVSE goes to sleep after time/charge limit met.. would stay in sleep
-> automatically cancel sleep mode when car disconnected *only if* the
sleep was induced by time/charge limit
2. decouple temperature monitoring from J1772EVSEController::Update()
-> so that temperature is still monitored when EVSE disabled/sleeping
3. ProcessInputs() removed from J1772EVSEController
4. added TEMPERATURE_MONITORING_NY (not yet) code .. currently disabled
-> $GO/$SO RAPI
-> added ambient/ir_thresh support

vD3.9.4 SCL 20150611
- reduce GFI self test pulse duration from 50% to 33%

vD3.9.3.1 SCL 20150611
- craigK PR #46

vD3.9.3 SCL 20150608
- add files and edits to restore I2CLCD_PCF8574 build capability
- broken DelayTimer() introduced in 3.9.0

vD3.9.2 SCL 20150606
- fix $GF bug

vD3.9.1 SCL 20150605
- boost I2C bus to 400KHz


SCL20150605
-> promote to v3.9.0 in stable branch
Many thanks to CraigK for his numerous contributions and top notch testing.
Expand Down
7 changes: 3 additions & 4 deletions Gfi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@ uint8_t Gfi::SelfTest()
{
testInProgress = 1;
testSuccess = 0;
for(int i=0; i < GFI_TEST_CYCLES; i++) {
for(int i=0; !testSuccess && (i < GFI_TEST_CYCLES); i++) {
pinTest.write(1);
delayMicroseconds(GFI_PULSE_DURATION_US);
delayMicroseconds(GFI_PULSE_ON_US);
pinTest.write(0);
delayMicroseconds(GFI_PULSE_DURATION_US);
if (testSuccess) break; // no need to keep trying.
delayMicroseconds(GFI_PULSE_OFF_US);
}

// wait for GFI pin to clear
Expand Down
198 changes: 198 additions & 0 deletions I2CIO.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
// ---------------------------------------------------------------------------
// Created by Francisco Malpartida on 20/08/11.
// Copyright 2011 - Under creative commons license 3.0:
// Attribution-ShareAlike CC BY-SA
//
// This software is furnished "as is", without technical support, and with no
// warranty, express or implied, as to its usefulness for any purpose.
//
// Thread Safe: No
// Extendable: Yes
//
// @file I2CIO.h
// This file implements a basic IO library using the PCF8574 I2C IO Expander
// chip.
//
// @brief
// Implement a basic IO library to drive the PCF8574* I2C IO Expander ASIC.
// The library implements basic IO general methods to configure IO pin direction
// read and write uint8_t operations and basic pin level routines to set or read
// a particular IO port.
//
//
// @version API 1.0.0
//
// @author F. Malpartida - fmalpartida@gmail.com
// ---------------------------------------------------------------------------
#if (ARDUINO < 100)
#include <WProgram.h>
#else
#include <Arduino.h>
#endif

#include <inttypes.h>

#include "./Wire.h"
#include "./I2CIO.h"

// CLASS VARIABLES
// ---------------------------------------------------------------------------


// CONSTRUCTOR
// ---------------------------------------------------------------------------
I2CIO::I2CIO ( )
{
_i2cAddr = 0x0;
_dirMask = 0xFF; // mark all as INPUTs
_shadow = 0x0; // no values set
_initialised = false;
}

// PUBLIC METHODS
// ---------------------------------------------------------------------------

//
// begin
int I2CIO::begin ( uint8_t i2cAddr )
{
_i2cAddr = i2cAddr;

Wire.begin ( );

_initialised = Wire.requestFrom ( _i2cAddr, (uint8_t)1 );

#if (ARDUINO < 100)
_shadow = Wire.receive ();
#else
_shadow = Wire.read (); // Remove the byte read don't need it.
#endif

return ( _initialised );
}

//
// pinMode
void I2CIO::pinMode ( uint8_t pin, uint8_t dir )
{
if ( _initialised )
{
if ( OUTPUT == dir )
{
_dirMask &= ~( 1 << pin );
}
else
{
_dirMask |= ( 1 << pin );
}
}
}

//
// portMode
void I2CIO::portMode ( uint8_t dir )
{

if ( _initialised )
{
if ( dir == INPUT )
{
_dirMask = 0xFF;
}
else
{
_dirMask = 0x00;
}
}
}

//
// read
uint8_t I2CIO::read ( void )
{
uint8_t retVal = 0;

if ( _initialised )
{
Wire.requestFrom ( _i2cAddr, (uint8_t)1 );
#if (ARDUINO < 100)
retVal = ( _dirMask & Wire.receive ( ) );
#else
retVal = ( _dirMask & Wire.read ( ) );
#endif

}
return ( retVal );
}

//
// write
int I2CIO::write ( uint8_t value )
{
int status = 0;

if ( _initialised )
{
// Only write HIGH the values of the ports that have been initialised as
// outputs updating the output shadow of the device
_shadow = ( value & ~(_dirMask) );

Wire.beginTransmission ( _i2cAddr );
#if (ARDUINO < 100)
Wire.send ( _shadow );
#else
Wire.write ( _shadow );
#endif
status = Wire.endTransmission ();
}
return ( (status == 0) );
}

//
// digitalRead
uint8_t I2CIO::digitalRead ( uint8_t pin )
{
uint8_t pinVal = 0;

// Check if initialised and that the pin is within range of the device
// -------------------------------------------------------------------
if ( ( _initialised ) && ( pin <= 7 ) )
{
// Remove the values which are not inputs and get the value of the pin
pinVal = this->read() & _dirMask;
pinVal = ( pinVal >> pin ) & 0x01; // Get the pin value
}
return (pinVal);
}

//
// digitalWrite
int I2CIO::digitalWrite ( uint8_t pin, uint8_t level )
{
uint8_t writeVal;
int status = 0;

// Check if initialised and that the pin is within range of the device
// -------------------------------------------------------------------
if ( ( _initialised ) && ( pin <= 7 ) )
{
// Only write to HIGH the port if the port has been configured as
// an OUTPUT pin. Add the new state of the pin to the shadow
writeVal = ( 1 << pin ) & ~_dirMask;
if ( level == HIGH )
{
_shadow |= writeVal;

}
else
{
_shadow &= ~writeVal;
}
status = this->write ( _shadow );
}
return ( status );
}

//
// PRIVATE METHODS
// ---------------------------------------------------------------------------
Loading

0 comments on commit 964178c

Please sign in to comment.