diff --git a/include/sta/utils/logger.tpp b/include/sta/utils/logger.tpp index d46b369..b125de9 100644 --- a/include/sta/utils/logger.tpp +++ b/include/sta/utils/logger.tpp @@ -188,17 +188,10 @@ namespace sta uint32_t address = start_ * W25QXX_SECTOR_SIZE + i * sizeof(T); // If the requested element is in the cache, read it from there. - if (address / W25QXX_PAGE_SIZE == address_ / W25QXX_PAGE_SIZE) - { - uint8_t * ptr = buffer_ + address % W25QXX_PAGE_SIZE; - return *reinterpret_cast(ptr); - } - else - { - uint8_t buffer[sizeof(T)]; - flash_->readData(address, buffer, sizeof(T)); - return *reinterpret_cast(buffer); - } + + uint8_t buffer[sizeof(T)]; + flash_->readData(address, buffer, sizeof(T)); + return *reinterpret_cast(buffer); } } // namespace sta