Skip to content

Commit 4d73c33

Browse files
committed
Fix roll over bug and bad single =.
1 parent a3da617 commit 4d73c33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SparkFun_External_EEPROM.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ uint16_t ExternalEEPROM::detectPageSizeBytes()
378378
for (uint16_t x = 0; x < maxPageSize; x++)
379379
originalValuesArray[x] = read(testLocation + x); // Read byte wise to avoid page size limitations
380380

381-
uint8_t pageSizeBytes = 8;
381+
uint16_t pageSizeBytes = 8;
382382
bool detectedPageSize = false;
383383
while (1)
384384
{
@@ -437,7 +437,7 @@ uint16_t ExternalEEPROM::detectPageSizeBytes()
437437
pageSizeBytes *= 2;
438438
else if (pageSizeBytes == 32)
439439
pageSizeBytes = 128;
440-
else if (pageSizeBytes = maxPageSize)
440+
else if (pageSizeBytes == maxPageSize)
441441
break; // EEPROMs with larger than 256 byte page writes are not known at this time.
442442

443443
// We can't write more than I2C_BUFFER_LENGTH_TX at a time so that is the limit of our pageSize testing.

0 commit comments

Comments
 (0)