Skip to content

Commit 8dcc949

Browse files
authored
Merge pull request #8002 from deepikabhavnani/storage_remove_mbed_h
Storage: Add required header file and namespace element instead add all
2 parents 24857d0 + 8642ece commit 8dcc949

17 files changed

+28
-29
lines changed

features/storage/blockdevice/BufferedBlockDevice.cpp

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

1717
#include "BufferedBlockDevice.h"
18-
#include "mbed_assert.h"
19-
#include "mbed_critical.h"
18+
#include "platform/mbed_assert.h"
19+
#include "platform/mbed_critical.h"
2020
#include <algorithm>
2121
#include <string.h>
2222

features/storage/blockdevice/ChainingBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#include "ChainingBlockDevice.h"
18-
#include "mbed_critical.h"
18+
#include "platform/mbed_critical.h"
1919

2020

2121
ChainingBlockDevice::ChainingBlockDevice(BlockDevice **bds, size_t bd_count)

features/storage/blockdevice/ChainingBlockDevice.h

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

2525
#include "BlockDevice.h"
26-
#include "mbed.h"
27-
26+
#include "platform/mbed_assert.h"
27+
#include <stdlib.h>
2828

2929
/** Block device for chaining multiple block devices
3030
* with the similar block sizes at sequential addresses
@@ -45,8 +45,7 @@
4545
* ChainingBlockDevice chainmem(bds);
4646
* @endcode
4747
*/
48-
class ChainingBlockDevice : public BlockDevice
49-
{
48+
class ChainingBlockDevice : public BlockDevice {
5049
public:
5150
/** Lifetime of the memory block device
5251
*
@@ -179,5 +178,4 @@ class ChainingBlockDevice : public BlockDevice
179178
bool _is_initialized;
180179
};
181180

182-
183181
#endif

features/storage/blockdevice/ExhaustibleBlockDevice.cpp

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

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

2221
ExhaustibleBlockDevice::ExhaustibleBlockDevice(BlockDevice *bd, uint32_t erase_cycles)
2322
: _bd(bd), _erase_array(NULL), _erase_cycles(erase_cycles), _init_ref_count(0), _is_initialized(false)

features/storage/blockdevice/FlashSimBlockDevice.cpp

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

1717
#include "FlashSimBlockDevice.h"
18-
#include "mbed_assert.h"
19-
#include "mbed_critical.h"
18+
#include "platform/mbed_assert.h"
19+
#include "platform/mbed_critical.h"
2020
#include <algorithm>
2121
#include <stdlib.h>
2222
#include <string.h>

features/storage/blockdevice/HeapBlockDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
#include "HeapBlockDevice.h"
18-
#include "mbed_critical.h"
18+
#include "platform/mbed_critical.h"
1919

2020

2121
HeapBlockDevice::HeapBlockDevice(bd_size_t size, bd_size_t block)

features/storage/blockdevice/HeapBlockDevice.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
#define MBED_MEM_BLOCK_DEVICE_H
2424

2525
#include "BlockDevice.h"
26-
#include "mbed.h"
27-
26+
#include "platform/mbed_assert.h"
27+
#include <string.h>
28+
#include <stdlib.h>
2829

2930
/** Lazily allocated heap-backed block device
3031
*

features/storage/blockdevice/MBRBlockDevice.cpp

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

1717
#include "MBRBlockDevice.h"
18-
#include "mbed_critical.h"
18+
#include "platform/mbed_critical.h"
19+
#include "platform/mbed_toolchain.h"
20+
#include "platform/mbed_assert.h"
1921
#include <algorithm>
20-
22+
#include <string.h>
2123

2224
// On disk structures, all entries are little endian
2325
MBED_PACKED(struct) mbr_entry {

features/storage/blockdevice/MBRBlockDevice.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#define MBED_MBR_BLOCK_DEVICE_H
2424

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

2827

2928
/** Additional error codes used for MBR records

features/storage/blockdevice/ObservingBlockDevice.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
#include "ObservingBlockDevice.h"
2424
#include "ReadOnlyBlockDevice.h"
25-
#include "mbed.h"
2625

2726

2827
ObservingBlockDevice::ObservingBlockDevice(BlockDevice *bd)
@@ -36,7 +35,7 @@ ObservingBlockDevice::~ObservingBlockDevice()
3635
// Does nothing
3736
}
3837

39-
void ObservingBlockDevice::attach(Callback<void(BlockDevice *)> cb)
38+
void ObservingBlockDevice::attach(mbed::Callback<void(BlockDevice *)> cb)
4039
{
4140
_change = cb;
4241
}

features/storage/blockdevice/ObservingBlockDevice.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#define MBED_OBSERVING_BLOCK_DEVICE_H
2424

2525
#include "BlockDevice.h"
26-
#include "PlatformMutex.h"
27-
#include "Callback.h"
26+
#include "platform/PlatformMutex.h"
27+
#include "platform/Callback.h"
2828

2929

3030
class ObservingBlockDevice : public BlockDevice

features/storage/blockdevice/ProfilingBlockDevice.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#define MBED_PROFILING_BLOCK_DEVICE_H
2424

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

2827

2928
/** Block device for measuring storage operations of another block device

features/storage/blockdevice/ReadOnlyBlockDevice.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "ReadOnlyBlockDevice.h"
2424
#include "mbed_error.h"
2525

26-
2726
ReadOnlyBlockDevice::ReadOnlyBlockDevice(BlockDevice *bd)
2827
: _bd(bd)
2928
{

features/storage/blockdevice/SlicingBlockDevice.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
#define MBED_SLICING_BLOCK_DEVICE_H
2424

2525
#include "BlockDevice.h"
26-
#include "mbed.h"
27-
26+
#include "platform/mbed_assert.h"
2827

2928
/** Block device for mapping to a slice of another block device
3029
*

features/storage/filesystem/fat/FATFileSystem.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include <errno.h>
3030
////// Error handling /////
3131

32+
using namespace mbed;
33+
3234
static int fat_error_remap(FRESULT res)
3335
{
3436
switch(res) {

features/storage/filesystem/littlefs/LittleFileSystem.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "lfs_util.h"
2121
#include "MbedCRC.h"
2222

23+
using namespace mbed;
24+
2325
extern "C" void lfs_crc(uint32_t *crc, const void *buffer, size_t size)
2426
{
2527
uint32_t initial_xor = *crc;

features/storage/nvstore/TESTS/nvstore/functionality/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ static void nvstore_multi_thread_test()
510510
if (!threads[i]) {
511511
goto mem_fail;
512512
}
513-
threads[i]->start(callback(thread_test_worker));
513+
threads[i]->start(mbed::callback(thread_test_worker));
514514
}
515515

516516
wait_ms(thr_test_num_secs * 1000);
@@ -635,7 +635,7 @@ static void nvstore_race_test()
635635
}
636636
delete[] dummy;
637637

638-
threads[i]->start(callback(race_test_worker, (void *) buffs[i]));
638+
threads[i]->start(mbed::callback(race_test_worker, (void *) buffs[i]));
639639
threads[i]->join();
640640
}
641641

0 commit comments

Comments
 (0)