Skip to content

fix namespaces for MBED_NO_GLOBAL_USING_DIRECTIVE feature #13568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions drivers/usb/include/usb/USBMSD.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class USBMSD: public USBDevice {
* @param product_id Your product_id
* @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
Expand All @@ -95,7 +95,7 @@ class USBMSD: public USBDevice {
* @param product_id Your product_id
* @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
Expand Down Expand Up @@ -263,7 +263,7 @@ class USBMSD: public USBDevice {
events::Task<void(const setup_packet_t *)> _control_task;
events::Task<void()> _configure_task;

BlockDevice *_bd;
mbed::BlockDevice *_bd;
rtos::Mutex _mutex_init;
rtos::Mutex _mutex;

Expand Down
12 changes: 6 additions & 6 deletions drivers/usb/source/PolledQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
#include "platform/Callback.h"


PolledQueue::PolledQueue(mbed::Callback<void()> cb): _cb(cb)
events::PolledQueue::PolledQueue(mbed::Callback<void()> cb): _cb(cb)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this one to be in events namespace

{

}

PolledQueue::~PolledQueue()
events::PolledQueue::~PolledQueue()
{

}

void PolledQueue::dispatch()
void events::PolledQueue::dispatch()
{
core_util_critical_section_enter();
uint64_t buf[MBED_MAX_TASK_SIZE / sizeof(uint64_t)];
Expand Down Expand Up @@ -60,7 +60,7 @@ void PolledQueue::dispatch()
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();

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

void PolledQueue::post(TaskBase *task)
void events::PolledQueue::post(TaskBase *task)
{
core_util_critical_section_enter();

Expand All @@ -83,7 +83,7 @@ void PolledQueue::post(TaskBase *task)
core_util_critical_section_exit();
}

void PolledQueue::cancel(TaskBase *task)
void events::PolledQueue::cancel(TaskBase *task)
{
core_util_critical_section_enter();

Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/source/TaskBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "rtos/Semaphore.h"
#include "platform/mbed_critical.h"

namespace events {

TaskBase::TaskBase(TaskQueue *q)
: _queue(q), _posted(false), _start_count(0), _flush_sem(NULL)
{
Expand Down Expand Up @@ -150,3 +152,4 @@ void TaskBase::_wake_check()
_flush_sem = NULL;
}
}
}
12 changes: 6 additions & 6 deletions drivers/usb/source/USBMSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ enum Status {
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),
_initialized(false), _media_removed(false),
_addr(0), _length(0), _mem_ok(false), _block_size(0), _memory_size(0), _block_count(0),
Expand All @@ -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),
_initialized(false), _media_removed(false),
_addr(0), _length(0), _mem_ok(false), _block_size(0), _memory_size(0), _block_count(0),
Expand Down Expand Up @@ -230,15 +230,15 @@ bool USBMSD::media_removed()

int USBMSD::disk_read(uint8_t *data, uint64_t block, uint8_t count)
{
bd_addr_t addr = block * _bd->get_erase_size();
bd_size_t size = count * _bd->get_erase_size();
mbed::bd_addr_t addr = block * _bd->get_erase_size();
mbed::bd_size_t size = count * _bd->get_erase_size();
return _bd->read(data, addr, size);
}

int USBMSD::disk_write(const uint8_t *data, uint64_t block, uint8_t count)
{
bd_addr_t addr = block * _bd->get_erase_size();
bd_size_t size = count * _bd->get_erase_size();
mbed::bd_addr_t addr = block * _bd->get_erase_size();
mbed::bd_size_t size = count * _bd->get_erase_size();
int ret = _bd->erase(addr, size);
if (ret != 0) {
return ret;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class FlashIAPBlockDevice : public mbed::BlockDevice {
* @param size Size to erase in bytes
* @return True if erase is valid for underlying block device
*/
virtual bool is_valid_erase(bd_addr_t addr, bd_size_t size) const;
virtual bool is_valid_erase(mbed::bd_addr_t addr, mbed::bd_size_t size) const;


private:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
*/
enum qspif_bd_error {
QSPIF_BD_ERROR_OK = 0, /*!< no error */
QSPIF_BD_ERROR_DEVICE_ERROR = BD_ERROR_DEVICE_ERROR, /*!< device specific error -4001 */
QSPIF_BD_ERROR_DEVICE_ERROR = mbed::bd_error::BD_ERROR_DEVICE_ERROR, /*!< device specific error -4001 */
QSPIF_BD_ERROR_PARSING_FAILED = -4002, /* SFDP Parsing failed */
QSPIF_BD_ERROR_READY_FAILED = -4003, /* Wait for Mem Ready failed */
QSPIF_BD_ERROR_WREN_FAILED = -4004, /* Write Enable Failed */
Expand Down Expand Up @@ -289,7 +289,7 @@ class QSPIFBlockDevice : public mbed::BlockDevice {
qspi_status_t _qspi_set_frequency(int freq);

// Update the 4-byte addressing extension register with the MSB of the address if it is in use
qspi_status_t _qspi_update_4byte_ext_addr_reg(bd_addr_t addr);
qspi_status_t _qspi_update_4byte_ext_addr_reg(mbed::bd_addr_t addr);

/*********************************/
/* Flash Configuration Functions */
Expand Down
8 changes: 4 additions & 4 deletions storage/kvstore/kv_config/source/kv_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ int _storage_config_filesystem_common();
*
* @returns pointer to other block device.
*/
BlockDevice *get_other_blockdevice();
mbed::BlockDevice *get_other_blockdevice();

static const char *filesystemstore_folder_path = NULL;

Expand Down Expand Up @@ -560,10 +560,10 @@ BlockDevice *_get_blockdevice_default(bd_addr_t start_address, bd_size_t size)
* get_other_blockdevice() */
BlockDevice *_get_blockdevice_other(bd_addr_t start_address, bd_size_t size)
{
bd_addr_t aligned_end_address;
bd_addr_t aligned_start_address;
mbed::bd_addr_t aligned_end_address;
mbed::bd_addr_t aligned_start_address;

BlockDevice *bd = get_other_blockdevice();
mbed::BlockDevice *bd = get_other_blockdevice();
if (bd == NULL) {
tr_error("KV Config: \"other\" block device init fail");
return NULL;
Expand Down