Skip to content

Commit e43ceaa

Browse files
committed
Reduce compile warnings for Arduino Nano Every
#19
1 parent c63680f commit e43ceaa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/SparkFun_External_EEPROM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void ExternalEEPROM::read(uint32_t eepromLocation, uint8_t *buff, uint16_t buffe
166166
settings.i2cPort->write((uint8_t)((eepromLocation + received) & 0xFF)); // LSB
167167
settings.i2cPort->endTransmission();
168168

169-
settings.i2cPort->requestFrom((uint8_t)i2cAddress, (uint8_t)amtToRead);
169+
settings.i2cPort->requestFrom((uint8_t)i2cAddress, (size_t)amtToRead);
170170

171171
for (uint16_t x = 0; x < amtToRead; x++)
172172
buff[received + x] = settings.i2cPort->read();
@@ -190,7 +190,7 @@ void ExternalEEPROM::write(uint32_t eepromLocation, const uint8_t *dataToWrite,
190190
if (eepromLocation + bufferSize >= settings.memorySize_bytes)
191191
bufferSize = settings.memorySize_bytes - eepromLocation;
192192

193-
uint16_t maxWriteSize = settings.pageSize_bytes;
193+
int16_t maxWriteSize = settings.pageSize_bytes;
194194
if (maxWriteSize > I2C_BUFFER_LENGTH_TX - 2)
195195
maxWriteSize = I2C_BUFFER_LENGTH_TX - 2; //Arduino has 32 byte limit. We loose two to the EEPROM address
196196

src/SparkFun_External_EEPROM.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class ExternalEEPROM
141141
struct_memorySettings settings = {
142142
.i2cPort = &Wire,
143143
.deviceAddress = 0b1010000, // 0x50; format is 0b1010 + (A2 A1 A0) or 0b1010 + (B0 A1 A0) for larger (>512kbit) EEPROMs
144-
.memorySize_bytes = 512 * 1024 / 8, // equals 64 KB
144+
.memorySize_bytes = (uint32_t)512 * 1024 / 8, // equals 64 KB
145145
.pageSize_bytes = 64,
146146
.pageWriteTime_ms = 5,
147147
.pollForWriteComplete = true

0 commit comments

Comments
 (0)