Skip to content

Commit 509869d

Browse files
author
Cruz Monrreal
authored
Merge pull request #7663 from deepikabhavnani/namespace_bd_update
Move BlockDevice classes inside mbed namespace
2 parents 95c6233 + 8f2f6f4 commit 509869d

27 files changed

+127
-30
lines changed

features/filesystem/FileSystem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "platform/FileHandle.h"
2424
#include "platform/DirHandle.h"
2525
#include "platform/FileSystemLike.h"
26-
#include "BlockDevice.h"
26+
#include "bd/BlockDevice.h"
2727

2828
namespace mbed {
2929
/** \addtogroup filesystem */

features/filesystem/bd/BlockDevice.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@
1717
#ifndef MBED_BLOCK_DEVICE_H
1818
#define MBED_BLOCK_DEVICE_H
1919

20+
#include "platform/platform.h"
2021
#include <stdint.h>
2122

23+
namespace mbed {
24+
/** \addtogroup filesystem */
25+
/** @{*/
2226

2327
/** Enum of standard error codes
2428
*
@@ -219,5 +223,7 @@ class BlockDevice
219223
}
220224
};
221225

226+
/** @}*/
227+
} // namespace mbed
222228

223229
#endif

features/filesystem/bd/BufferedBlockDevice.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include <algorithm>
2121
#include <string.h>
2222

23+
namespace mbed {
24+
2325
static inline uint32_t align_down(bd_size_t val, bd_size_t size)
2426
{
2527
return val / size * size;
@@ -239,3 +241,5 @@ bd_size_t BufferedBlockDevice::size() const
239241
{
240242
return _bd->size();
241243
}
244+
245+
} // namespace mbed

features/filesystem/bd/BufferedBlockDevice.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424

2525
#include "BlockDevice.h"
2626

27+
namespace mbed {
28+
/** \addtogroup filesystem */
29+
/** @{*/
2730

2831
/** Block device for allowing minimal read and program sizes (of 1) for the underlying BD,
2932
* using a buffer on the heap.
@@ -163,5 +166,7 @@ class BufferedBlockDevice : public BlockDevice {
163166

164167
};
165168

169+
/** @}*/
170+
} // namespace mbed
166171

167172
#endif

features/filesystem/bd/ChainingBlockDevice.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
*/
1616

1717
#include "ChainingBlockDevice.h"
18-
#include "mbed_critical.h"
18+
#include "platform/mbed_critical.h"
19+
#include "platform/mbed_assert.h"
1920

21+
namespace mbed {
2022

2123
ChainingBlockDevice::ChainingBlockDevice(BlockDevice **bds, size_t bd_count)
2224
: _bds(bds), _bd_count(bd_count)
@@ -249,3 +251,5 @@ bd_size_t ChainingBlockDevice::size() const
249251
{
250252
return _size;
251253
}
254+
255+
} // namespace mbed

features/filesystem/bd/ChainingBlockDevice.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
#define MBED_CHAINING_BLOCK_DEVICE_H
2424

2525
#include "BlockDevice.h"
26-
#include "mbed.h"
2726

27+
namespace mbed {
28+
/** \addtogroup filesystem */
29+
/** @{*/
2830

2931
/** Block device for chaining multiple block devices
3032
* with the similar block sizes at sequential addresses
@@ -178,5 +180,7 @@ class ChainingBlockDevice : public BlockDevice
178180
uint32_t _init_ref_count;
179181
};
180182

183+
/** @}*/
184+
} // namespace mbed
181185

182186
#endif

features/filesystem/bd/ExhaustibleBlockDevice.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
*/
1616

1717
#include "ExhaustibleBlockDevice.h"
18-
#include "mbed.h"
19-
#include "mbed_critical.h"
18+
#include "platform/mbed_critical.h"
19+
#include "platform/mbed_assert.h"
2020

21+
namespace mbed {
2122

2223
ExhaustibleBlockDevice::ExhaustibleBlockDevice(BlockDevice *bd, uint32_t erase_cycles)
2324
: _bd(bd), _erase_array(NULL), _erase_cycles(erase_cycles), _init_ref_count(0)
@@ -141,3 +142,5 @@ bd_size_t ExhaustibleBlockDevice::size() const
141142
{
142143
return _bd->size();
143144
}
145+
146+
} // namespace mbed

features/filesystem/bd/ExhaustibleBlockDevice.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424

2525
#include "BlockDevice.h"
2626

27+
namespace mbed {
28+
/** \addtogroup filesystem */
29+
/** @{*/
2730

2831
/** Heap backed block device which simulates failures
2932
*
@@ -157,5 +160,7 @@ class ExhaustibleBlockDevice : public BlockDevice
157160
uint32_t _init_ref_count;
158161
};
159162

163+
/** @}*/
164+
} // namespace mbed
160165

161166
#endif

features/filesystem/bd/FlashSimBlockDevice.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@
1515
*/
1616

1717
#include "FlashSimBlockDevice.h"
18-
#include "mbed_assert.h"
19-
#include "mbed_critical.h"
18+
#include "platform/mbed_critical.h"
19+
#include "platform/mbed_assert.h"
20+
2021
#include <algorithm>
2122
#include <stdlib.h>
2223
#include <string.h>
2324

25+
namespace mbed {
26+
2427
static const bd_size_t min_blank_buf_size = 32;
2528

2629
static inline uint32_t align_up(bd_size_t val, bd_size_t size)
@@ -160,3 +163,5 @@ int FlashSimBlockDevice::get_erase_value() const
160163
{
161164
return _erase_value;
162165
}
166+
167+
} // namespace mbed

features/filesystem/bd/FlashSimBlockDevice.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424

2525
#include "BlockDevice.h"
2626

27+
namespace mbed {
28+
/** \addtogroup filesystem */
29+
/** @{*/
30+
2731
enum {
2832
BD_ERROR_NOT_ERASED = -3201,
2933
};
@@ -138,4 +142,7 @@ class FlashSimBlockDevice : public BlockDevice {
138142
uint32_t _init_ref_count;
139143
};
140144

145+
/** @}*/
146+
} // namespace mbed
147+
141148
#endif

0 commit comments

Comments
 (0)