Skip to content

Commit

Permalink
Merge pull request ARMmbed#13 from ARMmbed/david_erase_value
Browse files Browse the repository at this point in the history
Implement the get_erase_value function
  • Loading branch information
geky authored Apr 12, 2018
2 parents 5249645 + d46ad65 commit 97e27cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions SPIFBlockDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,8 @@ bd_size_t SPIFBlockDevice::size() const
{
return _size;
}

int SPIFBlockDevice::get_erase_value() const
{
return 0xFF;
}
11 changes: 11 additions & 0 deletions SPIFBlockDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,17 @@ class SPIFBlockDevice : public BlockDevice {
*/
virtual bd_size_t get_erase_size() const;

/** Get the value of storage when erased
*
* If get_erase_value returns a non-negative byte value, the underlying
* storage is 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 you can't
* rely on the value of erased storage
*/
virtual int get_erase_value() const;

/** Get the total size of the underlying device
*
* @return Size of the underlying device in bytes
Expand Down

0 comments on commit 97e27cd

Please sign in to comment.