mirror of https://github.com/ARMmbed/mbed-os.git
bd: Added get_erase_value function to the block device API
Default implementation returns -1 and is backwards compatiblepull/5925/head
parent
98611c8578
commit
7707c8b8b8
|
|
@ -85,7 +85,8 @@ public:
|
||||||
|
|
||||||
/** Erase blocks on a block device
|
/** Erase blocks on a block device
|
||||||
*
|
*
|
||||||
* The state of an erased block is undefined until it has been programmed
|
* The state of an erased block is undefined until it has been programmed,
|
||||||
|
* unless get_erase_value returns a non-negative byte value
|
||||||
*
|
*
|
||||||
* @param addr Address of block to begin erasing
|
* @param addr Address of block to begin erasing
|
||||||
* @param size Size to erase in bytes, must be a multiple of erase block size
|
* @param size Size to erase in bytes, must be a multiple of erase block size
|
||||||
|
|
@ -135,6 +136,20 @@ public:
|
||||||
return get_program_size();
|
return get_program_size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Get the value of storage when erased
|
||||||
|
*
|
||||||
|
* If get_erase_value returns a non-negative byte value, the underlying
|
||||||
|
* storage will be set to that value when erased, and storage containing
|
||||||
|
* that value can be programmed without another erase.
|
||||||
|
*
|
||||||
|
* @return The value of storage when erased, or -1 if the value of
|
||||||
|
* erased storage can't be relied on
|
||||||
|
*/
|
||||||
|
virtual int get_erase_value() const
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/** Get the total size of the underlying device
|
/** Get the total size of the underlying device
|
||||||
*
|
*
|
||||||
* @return Size of the underlying device in bytes
|
* @return Size of the underlying device in bytes
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue