Skip to content

Commit

Permalink
Add casts for ambiguity compilation warning on Arduino Due.
Browse files Browse the repository at this point in the history
Change architectures to "*" in library.properties file.
Closes #6, #8.
  • Loading branch information
JChristensen committed Dec 21, 2023
1 parent c19cf9e commit 031db93
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The **JC_EEPROM Library** has been tested with:
- ST Micro M24M02 (2M bit)
- Atmel AT24C256C (thanks to searobin)
- Microchip 24C16B, 24C32 (thanks to Diogko)
- AT24C02 and ESP-12F/ESP8266 (thanks to Thorsten)

The **JC_EEPROM Library** will **NOT** work with Microchip 24xx1025 as its control byte does not conform to the following assumptions.

Expand Down
6 changes: 3 additions & 3 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=JC_EEPROM
version=1.0.7
version=1.0.8
author=Jack Christensen <[email protected]>
maintainer=Jack Christensen <[email protected]>
sentence=Arduino library to support external I2C EEPROMs.
paragraph=Copyright (C) 2022 by Jack Christensen and licensed under GNU GPL v3.0.
paragraph=Copyright (C) 2022-2023 by Jack Christensen and licensed under GNU GPL v3.0.
category=Data Storage
url=https://github.com/JChristensen/JC_EEPROM
architectures=avr
architectures=*
4 changes: 2 additions & 2 deletions src/JC_EEPROM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ uint8_t JC_EEPROM::write(uint32_t addr, uint8_t* values, uint16_t nBytes)
Wire.beginTransmission(ctrlByte);
if (m_nAddrBytes == 2) Wire.write(static_cast<uint8_t>(addr >> 8)); // high addr byte
Wire.write(static_cast<uint8_t>(addr)); // low addr byte
Wire.write(values, nWrite);
Wire.write(values, static_cast<uint8_t>(nWrite));
txStatus = Wire.endTransmission();
if (txStatus != 0) return txStatus;

Expand Down Expand Up @@ -119,7 +119,7 @@ uint8_t JC_EEPROM::read(uint32_t addr, uint8_t* values, uint16_t nBytes)
uint8_t rxStatus = Wire.endTransmission();
if (rxStatus != 0) return rxStatus; // read error

Wire.requestFrom(ctrlByte, nRead);
Wire.requestFrom(ctrlByte, static_cast<uint8_t>(nRead));
for (byte i=0; i<nRead; i++) values[i] = Wire.read();

addr += nRead; // increment the EEPROM address
Expand Down

0 comments on commit 031db93

Please sign in to comment.