1.7.0 I2C_EEPROM

This commit is contained in:
rob tillaart 2022-12-03 12:40:41 +01:00
parent d2db4db43d
commit febfc3d3ad
6 changed files with 20 additions and 13 deletions

View File

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [1.7.0] - 2022-12-02
- fix #48 rewrote constructor.
## [1.6.2] - 2022-10-30
- Add RP2040 support to build-CI.
- Add CHANGELOG.md

View File

@ -1,7 +1,7 @@
//
// FILE: I2C_eeprom.cpp
// AUTHOR: Rob Tillaart
// VERSION: 1.6.2
// VERSION: 1.7.0
// PURPOSE: Arduino Library for external I2C EEPROM 24LC256 et al.
// URL: https://github.com/RobTillaart/I2C_EEPROM.git
//
@ -37,9 +37,9 @@
//
// PUBLIC FUNCTIONS
//
I2C_eeprom::I2C_eeprom(const uint8_t deviceAddress, TwoWire * wire)
I2C_eeprom::I2C_eeprom(const uint8_t deviceAddress, TwoWire * wire) :
I2C_eeprom(deviceAddress, I2C_PAGESIZE_24LC256, wire)
{
I2C_eeprom(deviceAddress, I2C_PAGESIZE_24LC256, wire);
}
@ -58,6 +58,7 @@ I2C_eeprom::I2C_eeprom(const uint8_t deviceAddress, const uint32_t deviceSize, T
#if defined (ESP8266) || defined(ESP32)
bool I2C_eeprom::begin(uint8_t sda, uint8_t scl)
{
// if (_wire == 0) Serial.println("zero"); // test #48
if ((sda < 255) && (scl < 255))
{
_wire->begin(sda, scl);
@ -74,6 +75,7 @@ bool I2C_eeprom::begin(uint8_t sda, uint8_t scl)
bool I2C_eeprom::begin()
{
// if (_wire == 0) Serial.println("zero"); // test #48
_wire->begin();
_lastWrite = 0;
return isConnected();

View File

@ -2,7 +2,7 @@
//
// FILE: I2C_eeprom.h
// AUTHOR: Rob Tillaart
// VERSION: 1.6.2
// VERSION: 1.7.0
// PURPOSE: Arduino Library for external I2C EEPROM 24LC256 et al.
// URL: https://github.com/RobTillaart/I2C_EEPROM.git
//
@ -13,7 +13,7 @@
#include "Wire.h"
#define I2C_EEPROM_VERSION (F("1.6.2"))
#define I2C_EEPROM_VERSION (F("1.7.0"))
#define I2C_DEVICESIZE_24LC512 65536
@ -113,10 +113,10 @@ public:
private:
uint8_t _deviceAddress;
uint32_t _lastWrite = 0; // for waitEEReady
uint32_t _deviceSize;
uint8_t _pageSize;
uint8_t _extraTWR = 0; // milliseconds
uint32_t _lastWrite = 0; // for waitEEReady
uint32_t _deviceSize = 0;
uint8_t _pageSize = 0;
uint8_t _extraTWR = 0; // milliseconds
// 24LC32..24LC512 use two bytes for memory address
// 24LC01..24LC16 use one-byte addresses + part of device address

View File

@ -17,7 +17,8 @@
// #define SERIAL_OUT SerialUSB
I2C_eeprom ee(0x50, I2C_DEVICESIZE_24LC256);
I2C_eeprom ee(0x50);
// I2C_eeprom ee(0x50, I2C_DEVICESIZE_24LC256);
uint32_t start, diff, totals = 0;

View File

@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/I2C_EEPROM.git"
},
"version": "1.6.2",
"version": "1.7.0",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*",

View File

@ -1,5 +1,5 @@
name=I2C_EEPROM
version=1.6.2
version=1.7.0
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Library for I2C EEPROMS