diff --git a/DataFlashBlockDevice.cpp b/DataFlashBlockDevice.cpp index e367b2d398..0d2309661a 100644 --- a/DataFlashBlockDevice.cpp +++ b/DataFlashBlockDevice.cpp @@ -446,6 +446,13 @@ bd_size_t DataFlashBlockDevice::get_erase_size() const return _block_size; } +bd_size_t DataFlashBlockDevice::get_erase_size(bd_addr_t addr) const +{ + DEBUG_PRINTF("erase size: %" PRIX16 "\r\n", _block_size); + + return _block_size; +} + bd_size_t DataFlashBlockDevice::size() const { DEBUG_PRINTF("device size: %" PRIX32 "\r\n", _device_size); diff --git a/DataFlashBlockDevice.h b/DataFlashBlockDevice.h index 31ced0c4d1..e73b40222f 100644 --- a/DataFlashBlockDevice.h +++ b/DataFlashBlockDevice.h @@ -139,6 +139,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 total size of the underlying device * * @return Size of the underlying device in bytes