Merge pull request #10 from ARMmbed/david_get_erase_size_overload

Implement the get_erase_size API (based on address)
pull/7774/head
Christopher Haster 2018-07-06 09:57:15 -05:00 committed by GitHub
commit ec2175067b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -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);

View File

@ -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