Use pageSize-constant instead of hardcoded value

pull/12446/head
Stephan Brunner 2020-02-17 21:25:47 +01:00
parent 267d8cc223
commit 76a177fafa
No known key found for this signature in database
GPG Key ID: D3CD7237AFB7EF6B
1 changed files with 1 additions and 1 deletions

View File

@ -227,7 +227,7 @@ int I2CEEBlockDevice::do_paged(const bd_addr_t &startAddress,
while (lengthDone != length)
{
/* Integer division => Round down */
uint8_t const currentPage = currentStartAddress / 256;
uint8_t const currentPage = currentStartAddress / pageSize;
bd_addr_t const nextPageBegin = (currentPage + 1) * pageSize;
bd_addr_t const currentReadEndAddressExclusive = std::min(nextPageBegin, startAddress + length);
bd_size_t const currentLength = currentReadEndAddressExclusive - currentStartAddress;