Skip to content

Commit 6042ea3

Browse files
author
Cruz Monrreal
authored
Merge pull request #8639 from offirko/offir-mbed-qspif3
Add get_erase_value() support
2 parents 9072b55 + 2df7258 commit 6042ea3

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,11 @@ bd_size_t QSPIFBlockDevice::size() const
514514
return _device_size_bytes;
515515
}
516516

517+
int QSPIFBlockDevice::get_erase_value() const
518+
{
519+
return 0xFF;
520+
}
521+
517522
/********************************/
518523
/* Different Device Csel Mgmt */
519524
/********************************/

components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,17 @@ class QSPIFBlockDevice : public BlockDevice {
191191
*/
192192
virtual bd_size_t get_erase_size(bd_addr_t addr);
193193

194+
/** Get the value of storage byte after it was erased
195+
*
196+
* If get_erase_value returns a non-negative byte value, the underlying
197+
* storage is set to that value when erased, and storage containing
198+
* that value can be programmed without another erase.
199+
*
200+
* @return The value of storage when erased, or -1 if you can't
201+
* rely on the value of erased storage
202+
*/
203+
virtual int get_erase_value() const;
204+
194205
/** Get the total size of the underlying device
195206
*
196207
* @return Size of the underlying device in bytes

0 commit comments

Comments
 (0)