fix namespaces for MBED_NO_GLOBAL_USING_DIRECTIVE feature

added namespaces in various files
pull/14031/head
Oliver Wildtgrube 2020-12-09 09:42:04 +01:00 committed by pennam
parent 8ca0e9f161
commit 6b0215c687
5 changed files with 22 additions and 19 deletions

View File

@ -76,7 +76,7 @@ public:
* @param product_id Your product_id * @param product_id Your product_id
* @param product_release Your preoduct_release * @param product_release Your preoduct_release
*/ */
USBMSD(BlockDevice *bd, bool connect_blocking = true, uint16_t vendor_id = 0x0703, uint16_t product_id = 0x0104, uint16_t product_release = 0x0001); USBMSD(mbed::BlockDevice *bd, bool connect_blocking = true, uint16_t vendor_id = 0x0703, uint16_t product_id = 0x0104, uint16_t product_release = 0x0001);
/** /**
* Fully featured constructor * Fully featured constructor
@ -95,7 +95,7 @@ public:
* @param product_id Your product_id * @param product_id Your product_id
* @param product_release Your preoduct_release * @param product_release Your preoduct_release
*/ */
USBMSD(USBPhy *phy, BlockDevice *bd, uint16_t vendor_id, uint16_t product_id, uint16_t product_release); USBMSD(USBPhy *phy, mbed::BlockDevice *bd, uint16_t vendor_id, uint16_t product_id, uint16_t product_release);
/** /**
* Destroy this object * Destroy this object
@ -263,7 +263,7 @@ private:
events::Task<void(const setup_packet_t *)> _control_task; events::Task<void(const setup_packet_t *)> _control_task;
events::Task<void()> _configure_task; events::Task<void()> _configure_task;
BlockDevice *_bd; mbed::BlockDevice *_bd;
rtos::Mutex _mutex_init; rtos::Mutex _mutex_init;
rtos::Mutex _mutex; rtos::Mutex _mutex;

View File

@ -21,17 +21,17 @@
#include "platform/Callback.h" #include "platform/Callback.h"
PolledQueue::PolledQueue(mbed::Callback<void()> cb): _cb(cb) events::PolledQueue::PolledQueue(mbed::Callback<void()> cb): _cb(cb)
{ {
} }
PolledQueue::~PolledQueue() events::PolledQueue::~PolledQueue()
{ {
} }
void PolledQueue::dispatch() void events::PolledQueue::dispatch()
{ {
core_util_critical_section_enter(); core_util_critical_section_enter();
uint64_t buf[MBED_MAX_TASK_SIZE / sizeof(uint64_t)]; uint64_t buf[MBED_MAX_TASK_SIZE / sizeof(uint64_t)];
@ -60,7 +60,7 @@ void PolledQueue::dispatch()
core_util_critical_section_exit(); core_util_critical_section_exit();
} }
void PolledQueue::attach(mbed::Callback<void()> cb) void events::PolledQueue::attach(mbed::Callback<void()> cb)
{ {
core_util_critical_section_enter(); core_util_critical_section_enter();
@ -69,7 +69,7 @@ void PolledQueue::attach(mbed::Callback<void()> cb)
core_util_critical_section_exit(); core_util_critical_section_exit();
} }
void PolledQueue::post(TaskBase *task) void events::PolledQueue::post(TaskBase *task)
{ {
core_util_critical_section_enter(); core_util_critical_section_enter();
@ -83,7 +83,7 @@ void PolledQueue::post(TaskBase *task)
core_util_critical_section_exit(); core_util_critical_section_exit();
} }
void PolledQueue::cancel(TaskBase *task) void events::PolledQueue::cancel(TaskBase *task)
{ {
core_util_critical_section_enter(); core_util_critical_section_enter();

View File

@ -21,6 +21,8 @@
#include "rtos/Semaphore.h" #include "rtos/Semaphore.h"
#include "platform/mbed_critical.h" #include "platform/mbed_critical.h"
namespace events {
TaskBase::TaskBase(TaskQueue *q) TaskBase::TaskBase(TaskQueue *q)
: _queue(q), _posted(false), _start_count(0), _flush_sem(NULL) : _queue(q), _posted(false), _start_count(0), _flush_sem(NULL)
{ {
@ -150,3 +152,4 @@ void TaskBase::_wake_check()
_flush_sem = NULL; _flush_sem = NULL;
} }
} }
}

View File

@ -65,7 +65,7 @@ enum Status {
CSW_ERROR, CSW_ERROR,
}; };
USBMSD::USBMSD(BlockDevice *bd, bool connect_blocking, uint16_t vendor_id, uint16_t product_id, uint16_t product_release) USBMSD::USBMSD(mbed::BlockDevice *bd, bool connect_blocking, uint16_t vendor_id, uint16_t product_id, uint16_t product_release)
: USBDevice(get_usb_phy(), vendor_id, product_id, product_release), : USBDevice(get_usb_phy(), vendor_id, product_id, product_release),
_initialized(false), _media_removed(false), _initialized(false), _media_removed(false),
_addr(0), _length(0), _mem_ok(false), _block_size(0), _memory_size(0), _block_count(0), _addr(0), _length(0), _mem_ok(false), _block_size(0), _memory_size(0), _block_count(0),
@ -81,7 +81,7 @@ USBMSD::USBMSD(BlockDevice *bd, bool connect_blocking, uint16_t vendor_id, uint1
} }
} }
USBMSD::USBMSD(USBPhy *phy, BlockDevice *bd, uint16_t vendor_id, uint16_t product_id, uint16_t product_release) USBMSD::USBMSD(USBPhy *phy, mbed::BlockDevice *bd, uint16_t vendor_id, uint16_t product_id, uint16_t product_release)
: USBDevice(phy, vendor_id, product_id, product_release), : USBDevice(phy, vendor_id, product_id, product_release),
_initialized(false), _media_removed(false), _initialized(false), _media_removed(false),
_addr(0), _length(0), _mem_ok(false), _block_size(0), _memory_size(0), _block_count(0), _addr(0), _length(0), _mem_ok(false), _block_size(0), _memory_size(0), _block_count(0),
@ -230,15 +230,15 @@ bool USBMSD::media_removed()
int USBMSD::disk_read(uint8_t *data, uint64_t block, uint8_t count) int USBMSD::disk_read(uint8_t *data, uint64_t block, uint8_t count)
{ {
bd_addr_t addr = block * _bd->get_erase_size(); mbed::bd_addr_t addr = block * _bd->get_erase_size();
bd_size_t size = count * _bd->get_erase_size(); mbed::bd_size_t size = count * _bd->get_erase_size();
return _bd->read(data, addr, size); return _bd->read(data, addr, size);
} }
int USBMSD::disk_write(const uint8_t *data, uint64_t block, uint8_t count) int USBMSD::disk_write(const uint8_t *data, uint64_t block, uint8_t count)
{ {
bd_addr_t addr = block * _bd->get_erase_size(); mbed::bd_addr_t addr = block * _bd->get_erase_size();
bd_size_t size = count * _bd->get_erase_size(); mbed::bd_size_t size = count * _bd->get_erase_size();
int ret = _bd->erase(addr, size); int ret = _bd->erase(addr, size);
if (ret != 0) { if (ret != 0) {
return ret; return ret;

View File

@ -147,7 +147,7 @@ int _storage_config_filesystem_common();
* *
* @returns pointer to other block device. * @returns pointer to other block device.
*/ */
BlockDevice *get_other_blockdevice(); mbed::BlockDevice *get_other_blockdevice();
static const char *filesystemstore_folder_path = NULL; static const char *filesystemstore_folder_path = NULL;
@ -559,10 +559,10 @@ BlockDevice *_get_blockdevice_default(bd_addr_t start_address, bd_size_t size)
* get_other_blockdevice() */ * get_other_blockdevice() */
BlockDevice *_get_blockdevice_other(bd_addr_t start_address, bd_size_t size) BlockDevice *_get_blockdevice_other(bd_addr_t start_address, bd_size_t size)
{ {
bd_addr_t aligned_end_address; mbed::bd_addr_t aligned_end_address;
bd_addr_t aligned_start_address; mbed::bd_addr_t aligned_start_address;
BlockDevice *bd = get_other_blockdevice(); mbed::BlockDevice *bd = get_other_blockdevice();
if (bd == NULL) { if (bd == NULL) {
tr_error("KV Config: \"other\" block device init fail"); tr_error("KV Config: \"other\" block device init fail");
return NULL; return NULL;