Fixing SDBlockDevice::size() and SPIFBlockDevice::size() to implement BlockDevice::size() const change.

pull/7774/head
Simon Hughes 2017-03-14 17:45:48 +00:00
parent b2fb488376
commit a8c85d30af
4 changed files with 8 additions and 7 deletions

View File

@ -341,11 +341,12 @@ bd_size_t SDBlockDevice::get_erase_size() const
return 512;
}
bd_size_t SDBlockDevice::size()
bd_size_t SDBlockDevice::size() const
{
_lock.lock();
bd_size_t sectors = _sectors;
_lock.unlock();
bd_size_t sectors = 0;
if(_is_initialized) {
sectors = _sectors;
}
return 512*sectors;
}

View File

@ -119,7 +119,7 @@ public:
*
* @return Size of the underlying device in bytes
*/
virtual bd_size_t size();
virtual bd_size_t size() const;
/** Enable or disable debugging
*

View File

@ -342,7 +342,7 @@ bd_size_t SPIFBlockDevice::get_erase_size() const
return SPIF_SE_SIZE;
}
bd_size_t SPIFBlockDevice::size()
bd_size_t SPIFBlockDevice::size() const
{
return _size;
}

View File

@ -130,7 +130,7 @@ public:
*
* @return Size of the underlying device in bytes
*/
virtual bd_size_t size();
virtual bd_size_t size() const;
private:
// Master side hardware