Skip to content

Commit

Permalink
Allow log full FUL to be written to last byte (#438)
Browse files Browse the repository at this point in the history
Fixes #406
  • Loading branch information
martinwork authored Aug 15, 2024
1 parent 50ae994 commit a8470a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/FSCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int FSCache::read(uint32_t address, const void *data, int len)
int bytesCopied = 0;

// Ensure that the operation is within the limits of the device
if (address < flash.getFlashStart() || address + len >= flash.getFlashEnd())
if (address < flash.getFlashStart() || address + len > flash.getFlashEnd())
return DEVICE_INVALID_PARAMETER;

// Read operation may span multiple cache boundaries... so we iterate over blocks as necessary.
Expand Down Expand Up @@ -116,7 +116,7 @@ int FSCache::write(uint32_t address, const void *data, int len)
int bytesCopied = 0;

// Ensure that the operation is within the limits of the device
if (address < flash.getFlashStart() || address + len >= flash.getFlashEnd())
if (address < flash.getFlashStart() || address + len > flash.getFlashEnd())
return DEVICE_INVALID_PARAMETER;

#ifdef CODAL_FS_CACHE_VALIDATE
Expand Down

0 comments on commit a8470a7

Please sign in to comment.