Skip to content

Commit dce716d

Browse files
author
David Saada
committed
Implement the get_erase_size API (based on address)
1 parent 78c4f98 commit dce716d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

SPIFBlockDevice.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,11 @@ bd_size_t SPIFBlockDevice::get_erase_size() const
329329
return SPIF_SE_SIZE;
330330
}
331331

332+
bd_size_t SPIFBlockDevice::get_erase_size(bd_addr_t addr) const
333+
{
334+
return SPIF_SE_SIZE;
335+
}
336+
332337
bd_size_t SPIFBlockDevice::size() const
333338
{
334339
return _size;

SPIFBlockDevice.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ class SPIFBlockDevice : public BlockDevice {
130130
*/
131131
virtual bd_size_t get_erase_size() const;
132132

133+
/** Get the size of an erasable block given address
134+
*
135+
* @param addr Address within the erasable block
136+
* @return Size of an erasable block in bytes
137+
* @note Must be a multiple of the program size
138+
*/
139+
virtual bd_size_t get_erase_size(bd_addr_t addr) const;
140+
133141
/** Get the value of storage when erased
134142
*
135143
* If get_erase_value returns a non-negative byte value, the underlying

0 commit comments

Comments
 (0)