Skip to content

Commit 8d73156

Browse files
committed
Remove inclusion of mbed.h from USB
Remove mbed.h from USB files and fix the build errors this causes. This is required to pass CI.
1 parent bd6e9aa commit 8d73156

21 files changed

+49
-47
lines changed

TESTS/usb_device/basic/USBEndpointTester.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
#include "stdint.h"
19+
#include "stdlib.h"
1920
#include "USBEndpointTester.h"
2021
#include "mbed_shared_queues.h"
2122
#include "EndpointResolver.h"
@@ -167,7 +168,7 @@ USBEndpointTester::USBEndpointTester(USBPhy *phy, uint16_t vendor_id, uint16_t p
167168
}
168169
MBED_ASSERT(resolver.valid());
169170

170-
queue = mbed_highprio_event_queue();
171+
queue = mbed::mbed_highprio_event_queue();
171172
configuration_desc(0);
172173
init();
173174
USBDevice::connect();

TESTS/usb_device/basic/USBEndpointTester.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class USBEndpointTester: public USBDevice {
7878
};
7979

8080
protected:
81-
EventQueue *queue;
81+
events::EventQueue *queue;
8282
rtos::EventFlags flags;
8383
uint8_t ctrl_buf[2048];
8484

TESTS/usb_device/basic/USBTester.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ USBTester::USBTester(USBPhy *phy, uint16_t vendor_id, uint16_t product_id, uint1
5454
int_in = resolver.endpoint_in(USB_EP_TYPE_INT, 64);
5555
int_out = resolver.endpoint_out(USB_EP_TYPE_INT, 64);
5656
MBED_ASSERT(resolver.valid());
57-
queue = mbed_highprio_event_queue();
57+
queue = mbed::mbed_highprio_event_queue();
5858

5959
configuration_desc(0);
6060

TESTS/usb_device/basic/USBTester.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class USBTester: public USBDevice {
106106
uint8_t int_in;
107107
uint8_t int_out;
108108
uint8_t int_buf[64];
109-
EventQueue *queue;
109+
events::EventQueue *queue;
110110
rtos::EventFlags flags;
111111
volatile uint32_t reset_count;
112112
volatile uint32_t suspend_count;

usb/device/USBAudio/USBAudio.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ void USBAudio::_init(uint32_t frequency_rx, uint8_t channel_count_rx, uint32_t f
145145
_vol_max = 0x0100;
146146
_vol_res = 0x0004;
147147

148-
_update_vol = callback(stub_volume);
149-
_tx_done = callback(stub_handler);
150-
_rx_done = callback(stub_handler);
148+
_update_vol = mbed::callback(stub_volume);
149+
_tx_done = mbed::callback(stub_handler);
150+
_rx_done = mbed::callback(stub_handler);
151151

152152
_rx_overflow = 0;
153153
_tx_underflow = 0;
@@ -348,7 +348,7 @@ float USBAudio::get_volume()
348348
return ret;
349349
}
350350

351-
void USBAudio::attach(Callback<void()> &cb)
351+
void USBAudio::attach(mbed::Callback<void()> &cb)
352352
{
353353
lock();
354354

@@ -360,25 +360,25 @@ void USBAudio::attach(Callback<void()> &cb)
360360
unlock();
361361
}
362362

363-
void USBAudio::attach_tx(Callback<void(AudioEvent)> &cb)
363+
void USBAudio::attach_tx(mbed::Callback<void(AudioEvent)> &cb)
364364
{
365365
lock();
366366

367367
_tx_done = cb;
368368
if (!_tx_done) {
369-
_tx_done = callback(stub_handler);
369+
_tx_done = mbed::callback(stub_handler);
370370
}
371371

372372
unlock();
373373
}
374374

375-
void USBAudio::attach_rx(Callback<void(AudioEvent)> &cb)
375+
void USBAudio::attach_rx(mbed::Callback<void(AudioEvent)> &cb)
376376
{
377377
lock();
378378

379379
_rx_done = cb;
380380
if (!_rx_done) {
381-
_rx_done = callback(stub_handler);
381+
_rx_done = mbed::callback(stub_handler);
382382
}
383383

384384
unlock();

usb/device/USBAudio/USBAudio.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,21 +222,21 @@ class USBAudio: protected USBDevice {
222222
* @param cb Callback to attach
223223
*
224224
*/
225-
void attach(Callback<void()> &cb);
225+
void attach(mbed::Callback<void()> &cb);
226226

227227
/** attach a Callback to Tx Done
228228
*
229229
* @param cb Callback to attach
230230
*
231231
*/
232-
void attach_tx(Callback<void(AudioEvent)> &cb);
232+
void attach_tx(mbed::Callback<void(AudioEvent)> &cb);
233233

234234
/** attach a Callback to Rx Done
235235
*
236236
* @param cb Callback to attach
237237
*
238238
*/
239-
void attach_rx(Callback<void(AudioEvent)> &cb);
239+
void attach_rx(mbed::Callback<void(AudioEvent)> &cb);
240240

241241
protected:
242242

@@ -303,13 +303,13 @@ class USBAudio: protected USBDevice {
303303
uint16_t _vol_res;
304304

305305
// callback to update volume
306-
Callback<void()> _update_vol;
306+
mbed::Callback<void()> _update_vol;
307307

308308
// callback transmit Done
309-
Callback<void(AudioEvent)> _tx_done;
309+
mbed::Callback<void(AudioEvent)> _tx_done;
310310

311311
// callback receive Done
312-
Callback<void(AudioEvent)> _rx_done;
312+
mbed::Callback<void(AudioEvent)> _rx_done;
313313

314314
// Number of times data was dropped due to an overflow
315315
uint32_t _rx_overflow;

usb/device/USBDevice/EndpointResolver.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "mbed.h"
1817
#include "EndpointResolver.h"
1918

2019
static uint32_t logical_to_index(uint32_t logical, bool in_not_out)

usb/device/USBDevice/EndpointResolver.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#ifndef ENDPOINT_RESOLVER_H
1818
#define ENDPOINT_RESOLVER_H
1919

20-
#include "mbed.h"
21-
2220
#include "USBPhy.h"
2321

2422
/**

usb/device/USBDevice/USBDevice.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include "stdint.h"
17+
#include <stdint.h>
18+
#include <string.h>
1819

1920
#include "USBDevice.h"
2021
#include "USBDescriptor.h"
2122
#include "usb_phy_api.h"
23+
#include "mbed_assert.h"
2224

2325
//#define DEBUG
2426

usb/device/USBDevice/USBDevice.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#ifndef USBDEVICE_H
1818
#define USBDEVICE_H
1919

20-
#include "mbed.h"
2120
#include "USBDevice_Types.h"
2221
#include "USBPhy.h"
2322
#include "mbed_critical.h"

0 commit comments

Comments
 (0)