From dce716d6d402e9d5b29aa9faf25738aa78c8fde1 Mon Sep 17 00:00:00 2001 From: David Saada Date: Wed, 4 Jul 2018 16:36:11 +0300 Subject: [PATCH] Implement the get_erase_size API (based on address) --- SPIFBlockDevice.cpp | 5 +++++ SPIFBlockDevice.h | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/SPIFBlockDevice.cpp b/SPIFBlockDevice.cpp index 64bf16e83c..e2a0a9e11d 100644 --- a/SPIFBlockDevice.cpp +++ b/SPIFBlockDevice.cpp @@ -329,6 +329,11 @@ bd_size_t SPIFBlockDevice::get_erase_size() const return SPIF_SE_SIZE; } +bd_size_t SPIFBlockDevice::get_erase_size(bd_addr_t addr) const +{ + return SPIF_SE_SIZE; +} + bd_size_t SPIFBlockDevice::size() const { return _size; diff --git a/SPIFBlockDevice.h b/SPIFBlockDevice.h index 811a9f81bb..853d0c5796 100644 --- a/SPIFBlockDevice.h +++ b/SPIFBlockDevice.h @@ -130,6 +130,14 @@ public: */ virtual bd_size_t get_erase_size() const; + /** Get the size of an erasable block given address + * + * @param addr Address within the erasable block + * @return Size of an erasable block in bytes + * @note Must be a multiple of the program size + */ + virtual bd_size_t get_erase_size(bd_addr_t addr) const; + /** Get the value of storage when erased * * If get_erase_value returns a non-negative byte value, the underlying