mirror of https://github.com/ARMmbed/mbed-os.git
Fixing SDBlockDevice::size() and SPIFBlockDevice::size() to implement BlockDevice::size() const change.
parent
b2fb488376
commit
a8c85d30af
|
@ -341,11 +341,12 @@ bd_size_t SDBlockDevice::get_erase_size() const
|
||||||
return 512;
|
return 512;
|
||||||
}
|
}
|
||||||
|
|
||||||
bd_size_t SDBlockDevice::size()
|
bd_size_t SDBlockDevice::size() const
|
||||||
{
|
{
|
||||||
_lock.lock();
|
bd_size_t sectors = 0;
|
||||||
bd_size_t sectors = _sectors;
|
if(_is_initialized) {
|
||||||
_lock.unlock();
|
sectors = _sectors;
|
||||||
|
}
|
||||||
return 512*sectors;
|
return 512*sectors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ public:
|
||||||
*
|
*
|
||||||
* @return Size of the underlying device in bytes
|
* @return Size of the underlying device in bytes
|
||||||
*/
|
*/
|
||||||
virtual bd_size_t size();
|
virtual bd_size_t size() const;
|
||||||
|
|
||||||
/** Enable or disable debugging
|
/** Enable or disable debugging
|
||||||
*
|
*
|
||||||
|
|
|
@ -342,7 +342,7 @@ bd_size_t SPIFBlockDevice::get_erase_size() const
|
||||||
return SPIF_SE_SIZE;
|
return SPIF_SE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bd_size_t SPIFBlockDevice::size()
|
bd_size_t SPIFBlockDevice::size() const
|
||||||
{
|
{
|
||||||
return _size;
|
return _size;
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@ public:
|
||||||
*
|
*
|
||||||
* @return Size of the underlying device in bytes
|
* @return Size of the underlying device in bytes
|
||||||
*/
|
*/
|
||||||
virtual bd_size_t size();
|
virtual bd_size_t size() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Master side hardware
|
// Master side hardware
|
||||||
|
|
Loading…
Reference in New Issue