Skip to content

Commit

Permalink
Update qspi.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
eh2k committed Apr 24, 2023
1 parent 95b8aa3 commit 2461b7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/per/qspi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ QSPIHandle::Impl::Write(uint32_t address, uint32_t size, uint8_t* buffer)
QSPIHandle::Result QSPIHandle::Impl::Erase(uint32_t start_addr,
uint32_t end_addr)
{
if((end_addr - start_addr) >= IS25LP080D_BLOCK_SIZE)
if((end_addr - start_addr) >= IS25LP080D_BLOCK_SIZE
&& ((end_addr - start_addr) % IS25LP080D_BLOCK_SIZE) == 0)
{
uint32_t block_addr;
uint32_t block_size = IS25LP080D_BLOCK_SIZE;
Expand Down

0 comments on commit 2461b7b

Please sign in to comment.