Skip to content

Commit 4b2fcd6

Browse files
committed
Bare metal profile: Enable USB basic and hid greentea test
1 parent 918d679 commit 4b2fcd6

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

TESTS/configs/baremetal.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"kv-global-api",
3232
"sd",
3333
"qspif",
34-
"cryptocell310"
34+
"cryptocell310",
35+
"drivers-usb"
3536
],
3637
"target_overrides": {
3738
"*": {

TESTS/usb_device/basic/USBEndpointTester.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
#if USB_DEVICE_TESTS
1919

20-
#if defined(MBED_CONF_RTOS_PRESENT)
21-
2220
#include "stdint.h"
2321
#include "stdlib.h"
2422
#include "USBEndpointTester.h"
@@ -173,7 +171,11 @@ USBEndpointTester::USBEndpointTester(USBPhy *phy, uint16_t vendor_id, uint16_t p
173171
MBED_ASSERT(_endpoint_buffs[i] != NULL);
174172
}
175173
MBED_ASSERT(resolver.valid());
174+
#if defined(MBED_CONF_RTOS_PRESENT)
176175
queue = mbed::mbed_highprio_event_queue();
176+
#else
177+
queue = mbed::mbed_event_queue();
178+
#endif
177179
configuration_desc(0);
178180
ctrl_buf = new uint8_t[CTRL_BUF_SIZE];
179181
init();
@@ -864,5 +866,5 @@ void USBEndpointTester::start_ep_in_abort_test()
864866
write_start(_endpoints[EP_BULK_IN], _endpoint_buffs[EP_BULK_IN], (*_endpoint_configs)[EP_BULK_IN].max_packet);
865867
write_start(_endpoints[EP_INT_IN], _endpoint_buffs[EP_INT_IN], (*_endpoint_configs)[EP_INT_IN].max_packet);
866868
}
867-
#endif
869+
868870
#endif //USB_DEVICE_TESTS

TESTS/usb_device/basic/USBTester.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
#if USB_DEVICE_TESTS
1919

20-
#if defined(MBED_CONF_RTOS_PRESENT)
21-
2220
#include "stdint.h"
2321
#include "USBTester.h"
2422
#include "mbed_shared_queues.h"
@@ -60,7 +58,11 @@ USBTester::USBTester(USBPhy *phy, uint16_t vendor_id, uint16_t product_id, uint1
6058
int_in = resolver.endpoint_in(USB_EP_TYPE_INT, 64);
6159
int_out = resolver.endpoint_out(USB_EP_TYPE_INT, 64);
6260
MBED_ASSERT(resolver.valid());
61+
#if defined(MBED_CONF_RTOS_PRESENT)
6362
queue = mbed::mbed_highprio_event_queue();
63+
#else
64+
queue = mbed::mbed_event_queue();
65+
#endif
6466
configuration_desc(0);
6567
ctrl_buf = new uint8_t[CTRL_BUF_SIZE];
6668
init();
@@ -706,5 +708,5 @@ void USBTester::epbulk_out_callback()
706708
read_finish(bulk_out);
707709
read_start(bulk_out, bulk_buf, sizeof(bulk_buf));
708710
}
709-
#endif
711+
710712
#endif //USB_DEVICE_TESTS

TESTS/usb_device/basic/main.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
#error [NOT_SUPPORTED] usb device tests not enabled
2020
#else
2121

22-
#if !defined(MBED_CONF_RTOS_PRESENT)
23-
#error [NOT_SUPPORTED] USB stack and test cases require RTOS to run.
24-
#else
25-
2622
#include <stdio.h>
2723
#include <string.h>
2824
#include "mbed.h"
@@ -669,5 +665,4 @@ int main()
669665
}
670666

671667
#endif // !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE
672-
#endif // !defined(MBED_CONF_RTOS_PRESENT)
673668
#endif // !defined(USB_DEVICE_TESTS)

TESTS/usb_device/hid/main.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
#error [NOT_SUPPORTED] usb device tests not enabled
2020
#else
2121

22-
#if !defined(MBED_CONF_RTOS_PRESENT)
23-
#error [NOT_SUPPORTED] USB stack and test cases require RTOS to run.
24-
#else
25-
2622
#if !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE
2723
#error [NOT_SUPPORTED] USB Device not supported for this target
2824
#else
@@ -393,5 +389,4 @@ int main()
393389
}
394390

395391
#endif // !defined(DEVICE_USBDEVICE) || !DEVICE_USBDEVICE
396-
#endif // !defined(MBED_CONF_RTOS_PRESENT)
397392
#endif // !defined(USB_DEVICE_TESTS)

0 commit comments

Comments
 (0)