From 0de303ff9522f8746551ff746a71a8d8640bba38 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Mon, 22 Apr 2024 18:38:03 +0200 Subject: [PATCH] Fix #72, parameter type requestFrom() (#73) - Fix #72, force requestFrom parameters to use int type --- CHANGELOG.md | 5 ++++- I2C_eeprom.cpp | 10 +++++----- I2C_eeprom.h | 4 ++-- library.json | 2 +- library.properties | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4abeb7c..a44ea25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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.8.5] - 2024-04-22 +- Fix #72, force requestFrom parameters to use int type + + ## [1.8.4] - 2024-04-20 - Fix #70, increase length internal buffer. - add compile time flag **EN_AUTO_WRITE_PROTECT** (thanks to microfoundry) @@ -13,7 +17,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - add URL to examples - minor edits. - ## [1.8.3] - 2024-03-28 - Fix #64, compiler warning. - add **verifyBlock(memoryAddress, buffer, length)** diff --git a/I2C_eeprom.cpp b/I2C_eeprom.cpp index 0c26897..fba5dd1 100644 --- a/I2C_eeprom.cpp +++ b/I2C_eeprom.cpp @@ -1,7 +1,7 @@ // // FILE: I2C_eeprom.cpp // AUTHOR: Rob Tillaart -// VERSION: 1.8.4 +// VERSION: 1.8.5 // PURPOSE: Arduino Library for external I2C EEPROM 24LC256 et al. // URL: https://github.com/RobTillaart/I2C_EEPROM @@ -651,12 +651,12 @@ uint8_t I2C_eeprom::_ReadBlock(const uint16_t memoryAddress, uint8_t * buffer, c uint8_t readBytes = 0; if (this->_isAddressSizeTwoWords) { - readBytes = _wire->requestFrom(_deviceAddress, length); + readBytes = _wire->requestFrom((int)_deviceAddress, (int)length); } else { uint8_t address = _deviceAddress | ((memoryAddress >> 8) & 0x07); - readBytes = _wire->requestFrom(address, length); + readBytes = _wire->requestFrom((int)address, (int)length); } yield(); // For OS scheduling uint8_t count = 0; @@ -692,12 +692,12 @@ bool I2C_eeprom::_verifyBlock(const uint16_t memoryAddress, const uint8_t * buff uint8_t readBytes = 0; if (this->_isAddressSizeTwoWords) { - readBytes = _wire->requestFrom(_deviceAddress, length); + readBytes = _wire->requestFrom((int)_deviceAddress, (int)length); } else { uint8_t address = _deviceAddress | ((memoryAddress >> 8) & 0x07); - readBytes = _wire->requestFrom(address, length); + readBytes = _wire->requestFrom((int)address, (int)length); } yield(); // For OS scheduling uint8_t count = 0; diff --git a/I2C_eeprom.h b/I2C_eeprom.h index ff439a3..48009bf 100644 --- a/I2C_eeprom.h +++ b/I2C_eeprom.h @@ -2,7 +2,7 @@ // // FILE: I2C_eeprom.h // AUTHOR: Rob Tillaart -// VERSION: 1.8.4 +// VERSION: 1.8.5 // PURPOSE: Arduino Library for external I2C EEPROM 24LC256 et al. // URL: https://github.com/RobTillaart/I2C_EEPROM @@ -11,7 +11,7 @@ #include "Wire.h" -#define I2C_EEPROM_VERSION (F("1.8.4")) +#define I2C_EEPROM_VERSION (F("1.8.5")) #define I2C_DEVICESIZE_24LC512 65536 #define I2C_DEVICESIZE_24LC256 32768 diff --git a/library.json b/library.json index c83e21f..f567d7b 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/I2C_EEPROM.git" }, - "version": "1.8.4", + "version": "1.8.5", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/library.properties b/library.properties index 0bc5cf2..5aa984f 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=I2C_EEPROM -version=1.8.4 +version=1.8.5 author=Rob Tillaart maintainer=Rob Tillaart sentence=Library for I2C EEPROMS