Merge pull request #8002 from deepikabhavnani/storage_remove_mbed_h

Storage: Add required header file and namespace element instead add all
pull/8301/merge
Anna Bridge 2018-10-12 11:06:35 +01:00 committed by GitHub
commit 8dcc949c63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 28 additions and 29 deletions

View File

@ -15,8 +15,8 @@
*/ */
#include "BufferedBlockDevice.h" #include "BufferedBlockDevice.h"
#include "mbed_assert.h" #include "platform/mbed_assert.h"
#include "mbed_critical.h" #include "platform/mbed_critical.h"
#include <algorithm> #include <algorithm>
#include <string.h> #include <string.h>

View File

@ -15,7 +15,7 @@
*/ */
#include "ChainingBlockDevice.h" #include "ChainingBlockDevice.h"
#include "mbed_critical.h" #include "platform/mbed_critical.h"
ChainingBlockDevice::ChainingBlockDevice(BlockDevice **bds, size_t bd_count) ChainingBlockDevice::ChainingBlockDevice(BlockDevice **bds, size_t bd_count)

View File

@ -23,8 +23,8 @@
#define MBED_CHAINING_BLOCK_DEVICE_H #define MBED_CHAINING_BLOCK_DEVICE_H
#include "BlockDevice.h" #include "BlockDevice.h"
#include "mbed.h" #include "platform/mbed_assert.h"
#include <stdlib.h>
/** Block device for chaining multiple block devices /** Block device for chaining multiple block devices
* with the similar block sizes at sequential addresses * with the similar block sizes at sequential addresses
@ -45,8 +45,7 @@
* ChainingBlockDevice chainmem(bds); * ChainingBlockDevice chainmem(bds);
* @endcode * @endcode
*/ */
class ChainingBlockDevice : public BlockDevice class ChainingBlockDevice : public BlockDevice {
{
public: public:
/** Lifetime of the memory block device /** Lifetime of the memory block device
* *
@ -179,5 +178,4 @@ protected:
bool _is_initialized; bool _is_initialized;
}; };
#endif #endif

View File

@ -15,9 +15,8 @@
*/ */
#include "ExhaustibleBlockDevice.h" #include "ExhaustibleBlockDevice.h"
#include "mbed.h" #include "platform/mbed_critical.h"
#include "mbed_critical.h" #include "platform/mbed_assert.h"
ExhaustibleBlockDevice::ExhaustibleBlockDevice(BlockDevice *bd, uint32_t erase_cycles) ExhaustibleBlockDevice::ExhaustibleBlockDevice(BlockDevice *bd, uint32_t erase_cycles)
: _bd(bd), _erase_array(NULL), _erase_cycles(erase_cycles), _init_ref_count(0), _is_initialized(false) : _bd(bd), _erase_array(NULL), _erase_cycles(erase_cycles), _init_ref_count(0), _is_initialized(false)

View File

@ -15,8 +15,8 @@
*/ */
#include "FlashSimBlockDevice.h" #include "FlashSimBlockDevice.h"
#include "mbed_assert.h" #include "platform/mbed_assert.h"
#include "mbed_critical.h" #include "platform/mbed_critical.h"
#include <algorithm> #include <algorithm>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@ -15,7 +15,7 @@
*/ */
#include "HeapBlockDevice.h" #include "HeapBlockDevice.h"
#include "mbed_critical.h" #include "platform/mbed_critical.h"
HeapBlockDevice::HeapBlockDevice(bd_size_t size, bd_size_t block) HeapBlockDevice::HeapBlockDevice(bd_size_t size, bd_size_t block)

View File

@ -23,8 +23,9 @@
#define MBED_MEM_BLOCK_DEVICE_H #define MBED_MEM_BLOCK_DEVICE_H
#include "BlockDevice.h" #include "BlockDevice.h"
#include "mbed.h" #include "platform/mbed_assert.h"
#include <string.h>
#include <stdlib.h>
/** Lazily allocated heap-backed block device /** Lazily allocated heap-backed block device
* *

View File

@ -15,9 +15,11 @@
*/ */
#include "MBRBlockDevice.h" #include "MBRBlockDevice.h"
#include "mbed_critical.h" #include "platform/mbed_critical.h"
#include "platform/mbed_toolchain.h"
#include "platform/mbed_assert.h"
#include <algorithm> #include <algorithm>
#include <string.h>
// On disk structures, all entries are little endian // On disk structures, all entries are little endian
MBED_PACKED(struct) mbr_entry { MBED_PACKED(struct) mbr_entry {

View File

@ -23,7 +23,6 @@
#define MBED_MBR_BLOCK_DEVICE_H #define MBED_MBR_BLOCK_DEVICE_H
#include "BlockDevice.h" #include "BlockDevice.h"
#include "mbed.h"
/** Additional error codes used for MBR records /** Additional error codes used for MBR records

View File

@ -22,7 +22,6 @@
#include "ObservingBlockDevice.h" #include "ObservingBlockDevice.h"
#include "ReadOnlyBlockDevice.h" #include "ReadOnlyBlockDevice.h"
#include "mbed.h"
ObservingBlockDevice::ObservingBlockDevice(BlockDevice *bd) ObservingBlockDevice::ObservingBlockDevice(BlockDevice *bd)
@ -36,7 +35,7 @@ ObservingBlockDevice::~ObservingBlockDevice()
// Does nothing // Does nothing
} }
void ObservingBlockDevice::attach(Callback<void(BlockDevice *)> cb) void ObservingBlockDevice::attach(mbed::Callback<void(BlockDevice *)> cb)
{ {
_change = cb; _change = cb;
} }

View File

@ -23,8 +23,8 @@
#define MBED_OBSERVING_BLOCK_DEVICE_H #define MBED_OBSERVING_BLOCK_DEVICE_H
#include "BlockDevice.h" #include "BlockDevice.h"
#include "PlatformMutex.h" #include "platform/PlatformMutex.h"
#include "Callback.h" #include "platform/Callback.h"
class ObservingBlockDevice : public BlockDevice class ObservingBlockDevice : public BlockDevice

View File

@ -23,7 +23,6 @@
#define MBED_PROFILING_BLOCK_DEVICE_H #define MBED_PROFILING_BLOCK_DEVICE_H
#include "BlockDevice.h" #include "BlockDevice.h"
#include "mbed.h"
/** Block device for measuring storage operations of another block device /** Block device for measuring storage operations of another block device

View File

@ -23,7 +23,6 @@
#include "ReadOnlyBlockDevice.h" #include "ReadOnlyBlockDevice.h"
#include "mbed_error.h" #include "mbed_error.h"
ReadOnlyBlockDevice::ReadOnlyBlockDevice(BlockDevice *bd) ReadOnlyBlockDevice::ReadOnlyBlockDevice(BlockDevice *bd)
: _bd(bd) : _bd(bd)
{ {

View File

@ -23,8 +23,7 @@
#define MBED_SLICING_BLOCK_DEVICE_H #define MBED_SLICING_BLOCK_DEVICE_H
#include "BlockDevice.h" #include "BlockDevice.h"
#include "mbed.h" #include "platform/mbed_assert.h"
/** Block device for mapping to a slice of another block device /** Block device for mapping to a slice of another block device
* *

View File

@ -29,6 +29,8 @@
#include <errno.h> #include <errno.h>
////// Error handling ///// ////// Error handling /////
using namespace mbed;
static int fat_error_remap(FRESULT res) static int fat_error_remap(FRESULT res)
{ {
switch(res) { switch(res) {

View File

@ -20,6 +20,8 @@
#include "lfs_util.h" #include "lfs_util.h"
#include "MbedCRC.h" #include "MbedCRC.h"
using namespace mbed;
extern "C" void lfs_crc(uint32_t *crc, const void *buffer, size_t size) extern "C" void lfs_crc(uint32_t *crc, const void *buffer, size_t size)
{ {
uint32_t initial_xor = *crc; uint32_t initial_xor = *crc;

View File

@ -510,7 +510,7 @@ static void nvstore_multi_thread_test()
if (!threads[i]) { if (!threads[i]) {
goto mem_fail; goto mem_fail;
} }
threads[i]->start(callback(thread_test_worker)); threads[i]->start(mbed::callback(thread_test_worker));
} }
wait_ms(thr_test_num_secs * 1000); wait_ms(thr_test_num_secs * 1000);
@ -635,7 +635,7 @@ static void nvstore_race_test()
} }
delete[] dummy; delete[] dummy;
threads[i]->start(callback(race_test_worker, (void *) buffs[i])); threads[i]->start(mbed::callback(race_test_worker, (void *) buffs[i]));
threads[i]->join(); threads[i]->join();
} }