Skip to content

Commit 76a177f

Browse files
committed
Use pageSize-constant instead of hardcoded value
1 parent 267d8cc commit 76a177f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/storage/blockdevice/COMPONENT_I2CEE/I2CEEBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ int I2CEEBlockDevice::do_paged(const bd_addr_t &startAddress,
227227
while (lengthDone != length)
228228
{
229229
/* Integer division => Round down */
230-
uint8_t const currentPage = currentStartAddress / 256;
230+
uint8_t const currentPage = currentStartAddress / pageSize;
231231
bd_addr_t const nextPageBegin = (currentPage + 1) * pageSize;
232232
bd_addr_t const currentReadEndAddressExclusive = std::min(nextPageBegin, startAddress + length);
233233
bd_size_t const currentLength = currentReadEndAddressExclusive - currentStartAddress;

0 commit comments

Comments
 (0)