Skip to content

Commit 6b0215c

Browse files
Oliver Wildtgrubepennam
authored andcommitted
fix namespaces for MBED_NO_GLOBAL_USING_DIRECTIVE feature
added namespaces in various files
1 parent 8ca0e9f commit 6b0215c

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

drivers/usb/include/usb/USBMSD.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class USBMSD: public USBDevice {
7676
* @param product_id Your product_id
7777
* @param product_release Your preoduct_release
7878
*/
79-
USBMSD(BlockDevice *bd, bool connect_blocking = true, uint16_t vendor_id = 0x0703, uint16_t product_id = 0x0104, uint16_t product_release = 0x0001);
79+
USBMSD(mbed::BlockDevice *bd, bool connect_blocking = true, uint16_t vendor_id = 0x0703, uint16_t product_id = 0x0104, uint16_t product_release = 0x0001);
8080

8181
/**
8282
* Fully featured constructor
@@ -95,7 +95,7 @@ class USBMSD: public USBDevice {
9595
* @param product_id Your product_id
9696
* @param product_release Your preoduct_release
9797
*/
98-
USBMSD(USBPhy *phy, BlockDevice *bd, uint16_t vendor_id, uint16_t product_id, uint16_t product_release);
98+
USBMSD(USBPhy *phy, mbed::BlockDevice *bd, uint16_t vendor_id, uint16_t product_id, uint16_t product_release);
9999

100100
/**
101101
* Destroy this object
@@ -263,7 +263,7 @@ class USBMSD: public USBDevice {
263263
events::Task<void(const setup_packet_t *)> _control_task;
264264
events::Task<void()> _configure_task;
265265

266-
BlockDevice *_bd;
266+
mbed::BlockDevice *_bd;
267267
rtos::Mutex _mutex_init;
268268
rtos::Mutex _mutex;
269269

drivers/usb/source/PolledQueue.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@
2121
#include "platform/Callback.h"
2222

2323

24-
PolledQueue::PolledQueue(mbed::Callback<void()> cb): _cb(cb)
24+
events::PolledQueue::PolledQueue(mbed::Callback<void()> cb): _cb(cb)
2525
{
2626

2727
}
2828

29-
PolledQueue::~PolledQueue()
29+
events::PolledQueue::~PolledQueue()
3030
{
3131

3232
}
3333

34-
void PolledQueue::dispatch()
34+
void events::PolledQueue::dispatch()
3535
{
3636
core_util_critical_section_enter();
3737
uint64_t buf[MBED_MAX_TASK_SIZE / sizeof(uint64_t)];
@@ -60,7 +60,7 @@ void PolledQueue::dispatch()
6060
core_util_critical_section_exit();
6161
}
6262

63-
void PolledQueue::attach(mbed::Callback<void()> cb)
63+
void events::PolledQueue::attach(mbed::Callback<void()> cb)
6464
{
6565
core_util_critical_section_enter();
6666

@@ -69,7 +69,7 @@ void PolledQueue::attach(mbed::Callback<void()> cb)
6969
core_util_critical_section_exit();
7070
}
7171

72-
void PolledQueue::post(TaskBase *task)
72+
void events::PolledQueue::post(TaskBase *task)
7373
{
7474
core_util_critical_section_enter();
7575

@@ -83,7 +83,7 @@ void PolledQueue::post(TaskBase *task)
8383
core_util_critical_section_exit();
8484
}
8585

86-
void PolledQueue::cancel(TaskBase *task)
86+
void events::PolledQueue::cancel(TaskBase *task)
8787
{
8888
core_util_critical_section_enter();
8989

drivers/usb/source/TaskBase.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include "rtos/Semaphore.h"
2222
#include "platform/mbed_critical.h"
2323

24+
namespace events {
25+
2426
TaskBase::TaskBase(TaskQueue *q)
2527
: _queue(q), _posted(false), _start_count(0), _flush_sem(NULL)
2628
{
@@ -150,3 +152,4 @@ void TaskBase::_wake_check()
150152
_flush_sem = NULL;
151153
}
152154
}
155+
}

drivers/usb/source/USBMSD.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ enum Status {
6565
CSW_ERROR,
6666
};
6767

68-
USBMSD::USBMSD(BlockDevice *bd, bool connect_blocking, uint16_t vendor_id, uint16_t product_id, uint16_t product_release)
68+
USBMSD::USBMSD(mbed::BlockDevice *bd, bool connect_blocking, uint16_t vendor_id, uint16_t product_id, uint16_t product_release)
6969
: USBDevice(get_usb_phy(), vendor_id, product_id, product_release),
7070
_initialized(false), _media_removed(false),
7171
_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
8181
}
8282
}
8383

84-
USBMSD::USBMSD(USBPhy *phy, BlockDevice *bd, uint16_t vendor_id, uint16_t product_id, uint16_t product_release)
84+
USBMSD::USBMSD(USBPhy *phy, mbed::BlockDevice *bd, uint16_t vendor_id, uint16_t product_id, uint16_t product_release)
8585
: USBDevice(phy, vendor_id, product_id, product_release),
8686
_initialized(false), _media_removed(false),
8787
_addr(0), _length(0), _mem_ok(false), _block_size(0), _memory_size(0), _block_count(0),
@@ -230,15 +230,15 @@ bool USBMSD::media_removed()
230230

231231
int USBMSD::disk_read(uint8_t *data, uint64_t block, uint8_t count)
232232
{
233-
bd_addr_t addr = block * _bd->get_erase_size();
234-
bd_size_t size = count * _bd->get_erase_size();
233+
mbed::bd_addr_t addr = block * _bd->get_erase_size();
234+
mbed::bd_size_t size = count * _bd->get_erase_size();
235235
return _bd->read(data, addr, size);
236236
}
237237

238238
int USBMSD::disk_write(const uint8_t *data, uint64_t block, uint8_t count)
239239
{
240-
bd_addr_t addr = block * _bd->get_erase_size();
241-
bd_size_t size = count * _bd->get_erase_size();
240+
mbed::bd_addr_t addr = block * _bd->get_erase_size();
241+
mbed::bd_size_t size = count * _bd->get_erase_size();
242242
int ret = _bd->erase(addr, size);
243243
if (ret != 0) {
244244
return ret;

storage/kvstore/kv_config/source/kv_config.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ int _storage_config_filesystem_common();
147147
*
148148
* @returns pointer to other block device.
149149
*/
150-
BlockDevice *get_other_blockdevice();
150+
mbed::BlockDevice *get_other_blockdevice();
151151

152152
static const char *filesystemstore_folder_path = NULL;
153153

@@ -559,10 +559,10 @@ BlockDevice *_get_blockdevice_default(bd_addr_t start_address, bd_size_t size)
559559
* get_other_blockdevice() */
560560
BlockDevice *_get_blockdevice_other(bd_addr_t start_address, bd_size_t size)
561561
{
562-
bd_addr_t aligned_end_address;
563-
bd_addr_t aligned_start_address;
562+
mbed::bd_addr_t aligned_end_address;
563+
mbed::bd_addr_t aligned_start_address;
564564

565-
BlockDevice *bd = get_other_blockdevice();
565+
mbed::BlockDevice *bd = get_other_blockdevice();
566566
if (bd == NULL) {
567567
tr_error("KV Config: \"other\" block device init fail");
568568
return NULL;

0 commit comments

Comments
 (0)